Sunday, 5 November 2017

java use of logical operator



Question 10:
What is nested if else
Ans:
In if statement there is another if statement is called nested if else statement.
If(9==9)
{  if(8=8)
Statement;
Else
Statement;
}
Else
Statement;


Question 11:
What are logical operator.
Ans:
AND( &&)      OR(||)             NOT(!)
These are logical operator.  
Question 12:
What is AND operator.
Ans:
Its result is only true when all the conditions are true. Otherwise its result is false.
Its symbol is &&.
Question 13:
What is OR operator.
Ans:
Its result is true when only one condition becomes true. Its result is only false when both conditions becomes false.
Its symbol is ||.

Question 14:
What is NOT operator.
Ans:
If condition is true its result is false if codition is false its result is true.
Its symbol is !
Question 15:
What is switch statement
Ans:
A switch statement executes statements based on the value of a variable or an
expression..

No comments:

Post a Comment