java tutorial

java tutorial

Java Programming Format

Java programming

Consider following basic format for making programs in JAVA. For example:

public class MyFirstJavaProgram {
/* This is my first java program.
* This will print 'Hello JAVA' as the output */

public static void main(String []args) {
System.out.println("Hello JAVA"); 
// prints Hello JAVA
}
}

JAVA Tokens

Tokens are among the smallest elements in JAVA program. Following are 5 different token types:

• Keywords

• Literals

• Identifiers

• Separators

• Operators

JAVA Statements

There are three principle bunches that envelop the various types of proclamations in Java:

• Expression statements change estimations of variables, call classes, and make objects.

• Declaration statements is to declare variables.

• Control Flow Statements decides the order in which statements are to be executed.

 

//declaration statement
	int a;

	//expression statement
	 a = 3;

	//control flow statement
	if (a < 20 )
	{
	//expression statement
	System.out.println(a + " is less than twenty");
	}

Leave a Reply

Your email address will not be published. Required fields are marked *