This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Addition of valueOf(primitive) to K&B for SCJP5? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Addition of valueOf(primitive) to K&B for SCJP5?" Watch "Addition of valueOf(primitive) to K&B for SCJP5?" New topic
Author

Addition of valueOf(primitive) to K&B for SCJP5?

Peter Gade Christensen
Greenhorn

Joined: Sep 23, 2006
Posts: 25
When working with valueOf Methods that return wrapper classes, I think Bert and Kathy need to mention the fact that valueOf can take a primitive (thanks Barry!) too and not only a string and a string+radix?

Eg: Integer i2 = Integer.valueOf("43") returns Integer 43
and so does
Integer i3 = Integer.valueOf(43);

Probably need to include it in Table 3-3 (pg 233) ?

The content of the book is awesome !! (Thanks guys) but the binding is not that great , my books is pretty much in pages and I am using binder clips to keep them bound !

[ September 24, 2006: Message edited by: Barry Gaunt ]
[ September 24, 2006: Message edited by: Peter Gade Christensen ]
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
I can't speak for Kathy and Bert, but I think they only include information in the book if it's pertinent for the exam.

I'm not sure about your issue with the binding. I have a copy, and the binding is fine.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
I agree with Peter. The valueOf methods that take primitives are very relevant to the exam. They were introduced in Java 5.0 and the autoboxing mechanism depends on them.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Peter Gade Christensen
Greenhorn

Joined: Sep 23, 2006
Posts: 25
Bump to see if Bert takes a look see
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8805
    
    5
Hi Barry, Peter, and Keith,

I think I'm tending to side with Keith on this one, although I'm open for more discussion.

We make a lot of subjective calls about what parts of the API to include in the book - we almost never list all the methods of a given class, usually we list those that we think are on the exam or might be really useful or commonly used.

In other words, once we're sure we've covered the exam contents, we like to use the 80/20 rule to determine what else should be in the book. I guess that valueOf(primitive) is kind of interesting, but I'm not convinced it falls into the 80/20 category...

Again, I'm open to be convinced


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
 
 
subject: Addition of valueOf(primitive) to K&B for SCJP5?
 
Similar Threads
wrapper objects. equals and ==
Doubt with String Methods
Boolean Wrappers?
Programmer Certification Study
Doubt in K&B SCJP 5: topic 3 valueOf's