| Author |
a question waiting to be cleared
|
Mellihoney Michael
Ranch Hand
Joined: Nov 27, 2002
Posts: 124
|
|
Float t=new Float(0.9F); Float s=new Float(0.9F); Double u=new Double(0.9); which statements evaluates true? A.s==t B.s.equals(t) C.s==u D.t.equals(u) [ February 10, 2003: Message edited by: Mellihoney Michael ]
|
a beginner in java
|
 |
Igor Zeta
Ranch Hand
Joined: Nov 12, 2002
Posts: 40
|
|
t and s are equals but not ==. the other is neither equals nor ==
|
ciao<br />Igor Zeta<br />SCJP1.4
|
 |
Ramnath krishnamurthi
Ranch Hand
Joined: Jan 22, 2003
Posts: 56
|
|
s.equals(t) will work since s.equals(t) will compare the values. s == t will compare the objects in the heap. s == u will generate a compilation error. t.equals(u) are not equals since the values are different.
|
 |
Mellihoney Michael
Ranch Hand
Joined: Nov 27, 2002
Posts: 124
|
|
|
thanks,so answer is B?
|
 |
 |
|
|
subject: a question waiting to be cleared
|
|
|