Sunday, 17 July 2016

Java statements - Control statements

The statements in java are like sentences in natural language. A statement is an executable combination of tokens ending with 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 statements. Java supports the following type of statements.

  1. Empty statements 
  2. Expression statements 
  3. Labelled statements 
  4. Control statements 
  5. Synchronized statements
  6. Guarding statements    

Empty statements :- These no nothing and are used during programming development as a place holder.

Expression statements : Most statements are expression statements. Java has several types of expression statements like assignment, per-increment / Decrements  ext..

Labelled statements: Any statement may being with a label. Such label must not be a keywords, already declared local variables or previous used labels in this module.

Control statements: Control statements are three types selection, iteration, and jump statements.

Synchronized statements: These are used handling issues with multi threading.

Guarding statements : These are used for safe handling of code that may cause exceptions. These statements use the keywords try, catch, and finally.

0 comments:

Post a Comment

Scribe to Youtube Channel

Advertisement

Find Us On Facebook

C Programming

More

C++ Tutorial

More

Java Tutorial

More

software engineering

More

MS Office

More

Database Management

More
Top