my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Wrapper Classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Wrapper Classes" Watch "Wrapper Classes" New topic
Author

Wrapper Classes

suresh kamsa
Ranch Hand

Joined: Jul 30, 2001
Posts: 149
Why do we need wrapper classes. Where we implement them. Are they useful for certification exam.
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
The wrapper classes, Boolean, Byte, Short, Character, Integer, Float, Double are used anytime you need to represent a primitive value as an Object.
Yes, the exam does include questions on wrapper classes.
The next version of my mock exam will have a new set of questions on the Byte wrapper class. I hope to have it up by 5:00 PM Pacific Time today, Friday, August 9.


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Please read read this about Wrapper Classes and come back if things are not clear.
It's not perfect but will help to get the basic ideas.
Try Dan's exam.
-Barry
[ August 09, 2002: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
suresh kamsa
Ranch Hand

Joined: Jul 30, 2001
Posts: 149
Is wrapper objects are immutable?
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Yes, the wrapper classes, Boolean, Byte, Short, Character, Integer, Long, Float, and Double are immutable.
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
You will need a wrapper class anytime you want to store a primitive type (such as int or double) in a collection (such as a Set , List, or Map).


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Wrapper Classes
 
Similar Threads
immutable classes
Wrapper Classes
wrapper classes in servlets
Usage of Wrapper Classes
primary key type can't be primitive type. True?