Friday, 22 November 2019

UGC NET PAPER 2 June 2019 Question 23 (Shift-I)

23. What is the output of the following JAVA program
public class Good{
Private int m;
Public Good(int m){ this.m = m; }
public Boolean equals(Good n){ return n.m=m; }
public static void main(String args [ ]){
Good m1 = new Good(22);
Good m2 = new Good(22);
Object S1 = new Good(22);
Object S2 = new good(22);
System.out.println(m1.equals(m2));
System.out.println(m1.equals(s2));
System.out.println(m1.equals(s2));
System.out.println(s1.equals(m2));
}
}
E None of the above
A True, True, False, False
B True, false, True, false
C True, True, False, True
D true, False, False, False
ANS. D

PreviousNext
UGC NET CS 2018 July - II Question 22UGC NET CS 2018 July - II Question 24

No comments:

Post a Comment

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts