Home / Java Programming / Java.lang Class :: Discussion

Discussion :: Java.lang Class

  1. What will be the output of the program?

    String s = "hello";  Object o = s;  if( o.equals(s) ) {     System.out.println("A");  }  else {     System.out.println("B");  }  if( s.equals(o) ) {     System.out.println("C");  }  else {      System.out.println("D");  } 
    1. A
    2. B
    3. C
    4. D

  2. A.
    1 and 3
    B.
    2 and 4
    C.
    3 and 4
    D.
    1 and 2

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question. Let us discuss.


Be The First To Comment