If the class is Integer, then:
public static void main(String[] args){
Integer tlk=2;
Integer klt=2;
if(tlk==klt)
System.out.println("tlk is equal to klt");
}
About Question com.enthuware.ets.scjp.v6.2.160 :
Moderator: admin
-
- Site Admin
- Posts: 10068
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.160 :
This is not a valid scenario because the question clearly says, "o1 and o2 denote two object references to two different objects of same class."
So the given answer is correct.
So the given answer is correct.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 129 guests