• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

booleanValue()--help needed-exam in 2 days

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the Kathy Sierra book does not mention any method called booleanValue(), but when I ran the following code, it compiled well and on running , printed true.
public class juhi{
public static void main(String[]args){
Boolean b=new Boolean(true);
boolean b1=b.booleanValue();
System.out.println(b1);
}
}
SO in the exam, will we get a question on booleanValue(), and if we do, what shud we do ? According to the KB book, there r no such methods as charValue() and booleanValue(), so occurence of these methods in the code results in a compiler error.
 
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The exam objectives state the following:

Describe the significance of wrapper classes, including making appropriate selections in the wrapper classes to suit specified behavior requirements, stating the result of executing a fragment of code that includes an instance of one of the wrapper classes, and writing code using the following methods of the wrapper classes (e.g., Integer, Double, etc.):
o doubleValue
o floatValue
o intValue
o longValue
o parseXxx
o getXxx
o toString
o toHexString


Even though Boolean and Character wrapper classes are not mentioned explicitly, I would go ahead and refresh basic methods of Boolean and Character like their constructors, toString(), and xxxValue(). Good luck on the exam!!!
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jui -
I just took a look at pages 378-379. I suppose you can infer that the methods:
charValue() and booleanValue()
don't exist. What we're really getting at is that they won't be on the test. Sorry for the confusion. There are quite a few methods in the wrapper classes that are not covered on the exam, and we're focusing on only those methods that ARE on the exam.
There IS however an error in the Sun objectives. the getXxx methods are NOT covered on the exam, but the valueOf methods are covered, a LOT!
-Bert
 
Jui Mahajan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bert, so if we do get a method called booleanValue() or charValue() on the test, should we consider this as a compiler error and mark the answer likewise?
Thanks
jui
 
reply
    Bookmark Topic Watch Topic
  • New Topic