Home / Programming MCQs / JAVA MCQs / Question

R

Rajeev Malhotra • 3.97K Points
Extraordinary

Q. What is the output of this program?

Code:
public class Relational_operator_Example
    {
        public static void main(String args[])
        {
            int num1 = 7; 
            int num2 = 6;
            System.out.print(num1 > num2);
        } 
    }
(A) true
(B) false
(C) 1
(D) 0
Operator > returns a boolean value. 5 is not greater than 6 therefore false is returned.
output: true

You must be Logged in to update hint/solution

Discusssion

Login to discuss.