• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

a wrong answer of MindQ' exam

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The question is below:
What method(s) from the java.lang.Math class might method() be if the statement
method( -4.4 ) == -4;
is true.
a) round()
b) min()
c) trunc()
d) abs()
e) floor()
f) ceil()
The answer is a and f.but I think the only correct answer is a.Because the return type of ceil(double d) method is double.So the result of ceil(-4.4) should be -4.0
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, my dear friend the answers given are correct .Because the Math.ciel() function rounds off the value to the next higher integer which in case of -4.4 is -4.
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am appearing for the exam on the 20th . Can Any body help me get acess to mindq exam and other exam sites.
Any help regarding the certification is welcome
Thankful
preety
[email protected]
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the question, they are asking about TRUE. So, f is also correct. Since -4.0 == -4.
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
only answer a is correct. Because ceil(-4.4) returns -4.0 and not -4.
 
rainbow
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with sonkalp's viewpoint.Everyone must be more careful in the real exam.or somebody will make some simple mistakes.She(or he)will regret for this for a while.Thanks sonkalp.
hi,preety,you can login on maha's site.there are so much good links on it.its link is http://www.javaranch.com/maha/
Wish good luck to you.
 
reply
    Bookmark Topic Watch Topic
  • New Topic