Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Help coderanch get a
new server
by contributing to the
fundraiser
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Devaka Cooray
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
paul wheaton
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Carey Brown
Mikalai Zaikin
Bartenders:
Lou Hamers
Piet Souris
Frits Walraven
Forum:
Programmer Certification (OCPJP)
a question waiting to be cleared
Mellihoney Michael
Ranch Hand
Posts: 124
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 40
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
t and s are equals but not ==.
the other is neither equals nor ==
ciao<br />Igor Zeta<br />SCJP1.4
Ramnath krishnamurthi
Ranch Hand
Posts: 56
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 124
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
thanks,so answer is B?
a beginner in java
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Question about "=="
equals
equals
equal()
question about testing equal
More...