"if" statement can be used to check values of all data types of Java
Answers
Answered by
2
Answer:
yes if as well as else both can check any type of data type
Answered by
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
English,
4 months ago
Math,
4 months ago
Social Sciences,
4 months ago
Math,
9 months ago
Social Sciences,
9 months ago
Math,
1 year ago