Computer Science, asked by BadBoi69, 8 months ago

What is the function of nested if (JAVA)?​

Answers

Answered by priyarabadiya171
1

Answer:

nested id in java:

Explanation:

nested-if::==

  A nested if is an if statement that is the target of another if or else. Nested if statements means an if statement inside an if statement. Yes, java allows us to nest if statements within if statements. i.e, we can place an if statement inside another if statement.

syntex:

if(condition)  

{

  // Statements to execute if

  // condition is true

}

Here, condition after evaluation will be either true or false. if statement accepts boolean values – if the value is true then it will execute the block of statements under it.

If we do not provide the curly braces ‘{‘ and ‘}’ after if( condition ) then by default if statement will consider the immediate one statement to be inside its block. For example,

example:

if(condition)

  statement1;

  statement2;

// Here if the condition is true, if block  

// will consider only statement1 to be inside  

// its block.

Answered by sneha413639
5

Answer:

ʏօʊʀ ǟռֆաɛʀ ɨֆ ɨռ ȶɦɛ ǟȶȶǟƈɦʍɛռȶ.

Attachments:
Similar questions