...
Question 3665 – UGC NET CS 2016 July- paper-2
March 15, 2024
OOPS
March 16, 2024
Question 3665 – UGC NET CS 2016 July- paper-2
March 15, 2024
OOPS
March 16, 2024

JAVA

Question 26
​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));
}
}
A
True, True, False, False
B
True, false, True, false
C
True, True, False, True
D
true, False, False, False
E
None of the above
Question 26 Explanation: 

Note: Question is wrong, Change boolean to int data type then possibility option 4). Marks will be added to all.
Correct Answer: E
Question 26 Explanation: 

Note: Question is wrong, Change boolean to int data type then possibility option 4). Marks will be added to all.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!