Html/javascript

Java Statements | types of java statements

  -:Java Statements :-



     

-> The Statement  in Java are like sentences in natural languages.

-> A Statement is executable combination of tokens ending with a Semicolon  (;) mark.

-> Statements are usually executed in Sequence in the order in which they appear.

-> However, it is possible to control the flow of execution, if necessary, using special 


 



Classification of Java Statements

1: Empty Statement :- These do nothing and are used during program development as a place holder.


2: Labelled Statement :- Any Statement may begin with a label must not be keywords, already declared local labels variables or previously used labels in this module.

->In Java used as the arguments of Jump Statements, which are described later in this list.


3:- Expression Statement :- most Statements are expression statements.

->Java program has seven types of Expression -statements:-

*Assignment Statement

*Pre-Increment

*Pre-decrement

*post-Increment

*Post-decrement

*Method call and

*Expression


4:- Control Statements:- are used to control the flow of execution of a program based on certain conditions.


5:- Selection Statement :- These select one of several control flows.There are 3 types of selection statements in Java.

*if

*If-else

*Switch


6:-Iteration statements:- These specify how and when looping will take place.there are three types of Iteration statements.

*While

*do

*for


7:-Jump Statements :- they pass control to the beginning orend of the current block,or to a labelled statement.

->Such labels must be in the same block, and continue labels must be on a Iteration statements.

-> the four types of Jump Statements are :-

*break

*continue

*return and

*throw


8:- Synchronization Statements :-  These are used for handling with threading.


9:-Guarding Statements :-guarding statements are used for safe handling of code that may be cause exceptions  (such as division by zero ).

->These statements use the keywords try,  catch,  and  finally


Post a Comment

0 Comments