Home » JAVA Programming » Methods » Question
  1. What is the output of this program?

    class equal
    {
    int p;
    int q;
    boolean isequal()
    {
    return(p == q);
    }
    }
    public class Result
    {
    public static void main(String args[])
    {
    equal equ = new equal();
    equ.p = 7;
    equ.q = 5;
    System.out.println(equ.isequal());
    }
    }
    1. false
    2. true
    3. true false
    4. false true
    5. None of these
Correct Option: A

Output: false



Your comments will be displayed only after manual approval.