Sail E0 Webinar
Question


What is the output of this program?


class mainclass {
public static void main(String args[])
{
boolean var1 = true;
boolean var2 = false;
if (var1)
System.out.println(var1);
else
System.out.println(var2);
}
}
Options:
A .  0
B .  1
C .  true
D .  false
Answer: Option C

None.
output:
$ javac mainclass.java
$ java mainclass
true



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers