Rules and Regulations

The class name should start with a capital letter. This is not compulsory but it is a conventional rule. Java is a case sensitive. All keywords in Java are written in small letters. As a convention, anything that starts with a capital letter is treated as the name of a class in java. Following is a simple java program that prints “Hello world”.

Class Hello {

Public static void main (String args[]) {

System. Out.  println (“Hello World”);

}

}

In the above program, Hello is the class name. This program has the main method which has only one statement in it. In the above program public, static, void are keywords, main () is a method, String is a class, println () is a method and System is a class. Println is a method and system is a class. Let us save the program with the name Hello.java. Now we compile the program with the following compound in the dos prompt.

D :\> javac Hello.java

After the execution of this command, the .class files i.e. Hello. A class is created. In the other words, it is the dos command given to the java compiler to convert contents of the mentioned source into the equivalent bytecode. Now the following command is given to the JVM to execute the .class file.

D :\> java Hello.

In the process of executing the .class file one of the responsibilities of the JVM is to convert them.Class file into its equivalent executes code. We always use the edit plus editor for developing Java programs. The advantages of edit plus editor are that all the keywords are displayed in blue color. All the predefined classes are displayed in the red color other parts of the program is displayed in black. These colors differences help in identifying some of the syntactical errors/grammatical errors.

Simple Programming Java Help

Tutorspoint experts offer best Java programming assignments with solutions. send java assignment questions for Quick & Easy Answers