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 Problem with Wrapper class. 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 "Problem with Wrapper class." Watch "Problem with Wrapper class." New topic
Author

Problem with Wrapper class.

Abhinav Trivedi
Greenhorn

Joined: Mar 29, 2009
Posts: 10
Hi Everybody,

Actually I've a problem in understading of the wrapper classes and their functionalities. I mugged up all the books but practical aspect of using wrapper clases is still unsolved. can anybody give me a classic example of using wrapper classes and their functions.
I need only start.

Abhinav Trivedi
Accenture PVT limited, Pune, IDC, AIM- TrivediAcc@aol.com
Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
Hi abhinav
did you read K&B in which you can find good explanation regarding wrapper classes?
go through that..


SCJP5 and SCWCD1.5
Think Twice Act Wise...
sebastian tortschanoff
Ranch Hand

Joined: Mar 19, 2009
Posts: 68
Try something like this in a short main-method:



and then try to acces the int x and the Integer i via a dot operator like this:



Then you will see how powerfull wrapping really is. Its like youre wrapping an primitive in an Object to gain access to more powerfull higher-level methods. You'll see...


Power from within.

Failed SCJP 2 times :-(
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

If you have problem understanding the topic from K&B book then you can also try TMH Java Complete Reference. That may prove helpful


Regards, Sud.
SCJP 5 ScjpFAQ JLS
Abhinav Trivedi
Greenhorn

Joined: Mar 29, 2009
Posts: 10
sheker,

What i got from your code, In java you can't compare and use any function of object class on primitive. so first you should transform primitive into a object reference then you can use method which is implemented on object such as String class. Is that complete or anything missing ???
Abhinav Trivedi
Greenhorn

Joined: Mar 29, 2009
Posts: 10
What is K&B actually ?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

K&B stands for SCJP Study Guide by Kathy Sierra and Bert Bates...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
sebastian tortschanoff
Ranch Hand

Joined: Mar 19, 2009
Posts: 68
This book is pretty nice, though i've got headache from reading it every day.
My girlfriend is pretty and nice, too, though i've got headache...
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

sebastian tortschanoff wrote:This book is pretty nice, though i've got headache from reading it every day.


Yes the book is really good but not good to start with.To read this book you ,at least ,must go through the basics and write a lot of code and practice java
sebastian tortschanoff
Ranch Hand

Joined: Mar 19, 2009
Posts: 68
I agree.

One should already have made experience with other languages like c++ or c#, best with java. As a rookie you'll soon get get to your limits.

I've discovered soon, when i watched myself in the reflection looking like this: or sometimes like this , espezialy on chapter 6.
Praveen mourya Kumar
Greenhorn

Joined: Oct 14, 2008
Posts: 16
Abhinav Trivedi wrote:Hi Everybody,

Actually I've a problem in understanding of the wrapper classes and their functionality. I mugged up all the books but practical aspect of using wrapper classes is still unsolved. can anybody give me a classic example of using wrapper classes and their functions.
I need only start.


Brother, you Mugged up the basic thing..Please do some coding and try to understand how interpreator and compiler are doing for you.
You can learn more by understanding rather than simply mugging. i prefer K&B, read sentence by sentence and try to visualize on your own.javascript:emoticon('');


SCJP 1.6..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Wrapper class.