Hello There, Guest! RegisterLogin with Facebook
Login with Facebook

New Anna University Nov / Dec 2016 Examination Important Questions
New Anna University (UG / PG) Nov/Dec 2016 and Jan 2017 Theory , Practical Exam Timetable
>>> Anna University Sixth Semester Question Bank Collection (R2013) ECE,MECH,CSE,IT,EEE,CIVIL,EIE
>>> Anna University November/December 2015 Examination Question Papers
>>> Anna University Study Materials for all Departments
>>> Anna University Question Papers : April May June 2015 Question Papers | Nov Dec 2014 and Jan 2015 Question Papers

Register or Login to Submit Study Materials , Shoutbox and also to access Many Features !!

Vidyarthiplus Shop :: Handwritten Premium Lecture Notes
Share your Study Materials with us
Share your Study Materials with us : Click Here

Java: java statements
#1


Types of Java Statement
Control Statement
Assignment Statement

Control Statements
Conditional execution
Looping
Flow Control Statement

Types of Conditional Execution
If Statement
If – Else statement
If- Else-if statement
Switch Statement

If Statement

If statement in java encloses some code which is executed only if a condition is true. If statement only takes a boolean expression as its condition.

Note*: Unlike other languages Java does not accept numbers as conditional operators. It only considers boolean expressions as conditions which returns TRUE / FALSE.

Syntax of If Statement
if (true)
System.out.println("Hello! This will always get printed");

If Else Statement

If Else statement consists of one if condition and and one else part. It encloses some code which is executed only if the if condition is true, if its false then the else part of the code will be executed. If else statement takes boolean expression as its condition.

Note*: Unlike other languages, Java does not accept numbers as conditional operators. It only considers boolean expressions as conditions which returns TRUE / FALSE.
E.g if(1==1) is accepted as it is boolean expression and will return true. if(x=1) statement is not allowed in java.

If Else If Statement

If Else If statement consists of multiple if conditions and and an else part. If the if condition is true then the enclosed code will be executed. But if the if condition is false then it will check for the next if condition. If the next if condition is true then the enclosed code will be executed otherwise the else part of the code will be executed. If Else If statements takes boolean expression as its condition .

Note*: Unlike other language Java doesn’t accept numbers as conditional Operator. Only thing that can be accepted as condition is boolean expression which returns TRUE / FALSE.
E.g If(x=1) is not allowed while if(1==1) is accepted as it is boolean expression and will return true.

Types of Looping Statement

For Loop
While Loop
Do - While Loop

Types of Flow Control Statement

Return Statement
Continue Statement
Break Statement



Reply

Subscribe


Recommend on Google