File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes double   question in srinivas majji's mock exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "double   question in srinivas majji Watch "double   question in srinivas majji New topic
Author

double question in srinivas majji's mock exam

naraharirao mocherla
Ranch Hand

Joined: Aug 16, 2005
Posts: 45
can you please let me know why the answer B is correc. iknow that min is -0.0,max is 0.0.but i'm not sure sbout the Math.min-0.0,+0.0)== Math.max(0.0,+0.0));

can sombody help with this question.

public void check()
2: {
3: System.out.println(Math.min(-0.0,+0.0));
4: System.out.println(Math.max(-0.0,+0.0));
5: System.out.println(Math.min(-0.0,+0.0) == Math.max(0.0,+0.0));
6: }

A) prints -0.0, +0.0 and false.
B) prints -0.0, +0.0 and true.
C) prints 0.0, 0.0 and false.
D) prints 0.0, 0.0 and true.

B is correct answer in Srinivas Majji's mockexam
P Hunjan
Greenhorn

Joined: May 20, 2005
Posts: 16
Negative zero compares equal to regular zero (positive zero), but the two zeros may be distinguished by division: one divided by negative zero yields negative infinity; one divided by positive zero yields positive infinity.
 
GeeCON Prague 2014
 
subject: double question in srinivas majji's mock exam