Computer Science, asked by rudrapratapsingh15ap, 9 months ago

"if" statement can be used to check values of all data types of Java

Answers

Answered by anjaypandey150175
2

Answer:

yes if as well as else both can check any type of data type

Answered by vishakasaxenasl
0

Answer:

Yes, the "if" statement can be used to check the values of all data types of Java.

Explanation:

IF Statement

'If' is a selection statement that is not only supported in Java but also in many other programming languages. The primary purpose of using the If statement is to decide the control flow of the program.

For example:

You think if it rains today, I will not go to school.

And if there is no rain, I will go to school.

So here rain is the deciding factor whether you will go school or not.

In programming, we code it as:

if(rain==1)  //It is raining today

{

printf("I will not go to school today);

}

else{

printf("I will go to school today);

}

#SPJ2

Similar questions