Wednesday, August 11, 2021

# 2. Program Standard steps

                            Java Program Standard Steps
   
                                           


        Real Time Approach: 

Assume that we have a subject in graduation called Environmental studies. Imagine a university called JNTUH  is going to prepare ES question paper. Once done with the question paper they are going to distribute this with corresponding colleges. Then the students needs to write the exam in a booklet which consists of some rules and guidelines like it contains only 32 papers no additional will be provided, use only blue pen, don't use red or green pen like this some guidelines are there.

Once writing the exam is done the answer sheet should be validate or correction process. Validation is the process of checking answer sheet whether the answers are correct or not and following rules and regulations or not. This process is done by JNTU Faculty.

Finally the university execute the results of all the students. Look at the following approach

Semester Exams

Environmental Studies ===== >  JNTUH

1. Write the exam =====> Students

    Booklet

    Rules and Guidelines

2. Validation / Correction Process =====> JNTU Faculty

    2.1. PASS

    2.2. FAIL

3. Execute the results =====> JNTUH

          Three standard steps to write program in java :

In the same way Java is a programming language Created by Sun Microsystems Later it is handover to Oracle.

JAVA =====> Sun Micro Systems =====> Oracle

1. Write a program =====> Programmer

     notepad / notepad++ / editplus / editplus++ / IDE's Eclipse or Visual Studio or Netbeans

    Rules, Regulations and Syntaxes

    .java extension

               
After completion of a program we need to save that program by using .java extension.


          Example: Filename.java
                             Product.java 

2. Validation / Compilation =====> Compiler

    2.1. ERRORS

    2.2. PASS

Now there are two cases:

If there are errors in the program .class file is not generated. If there are no errors in the program .class file will be generated.

Case 1: There is no errors =====> .class file (Binary/Machine/0's and 1's) is                                                                       generated

Case 2: Errors =====> .class file is not generated

After the completion of java program by using compiler we will compile the program.

Compiler is a software that converts the source code to class file that is binary language or 0's and 1's.

3. Execute the program =====> JVM ( Java Virtual Machine )

    .class file is generated

JVM executes the .class file.

 

True or False Questions:

1. Compiler is always going to compile or executes .java files

    True

2. Compiler always generates .class files

    False

Because if a program have errors it will not generate .class file

3. Compiler is always going to generate the .class files if and only if it will follow all the java rules regulations and syntaxes.

    True

4. JVM always executes either .java or .class files

    False

5. Compiler always executes .class files

    False


No comments:

Post a Comment

# 16. control statements

 Control statements: In java, by using control statements we can tell the flow of execution. in which order the statements should execute. d...