MY mENU


Thursday, 9 February 2012

Statements in Java


Statements are equivalent to sentences in Natural Languages. A Statement forms a complete unit of execution. The following types of expressions can be made into a statement by terminating the expression with a semicolon (.

1. Assignment expressions
2. Any use of ++ or --
3. Method invocations
4. Object creation expressions

Such Statements are called Expression Statements.

Examples :

a = 8933.234;  assignment statement
a++;              increment statement
System.out.println("Hello JAVA !");       method invocation statement
Account acc = new Account();           object creation statement

- There are two other kinds of Statements :

1. Declaration Statements : A Declaration Statement declares a variable.
2. Control Flow Statements : Control Flow Statements regulate the order in which Statements get executed.

No comments:

Post a Comment