File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Wrapper class.

 
Abhinav Trivedi
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ganeshkumar cheekati
Ranch Hand
Posts: 362
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi abhinav
did you read K&B in which you can find good explanation regarding wrapper classes?
go through that..

 
sebastian tortschanoff
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
sudipto shekhar
Ranch Hand
Posts: 823
Chrome Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have problem understanding the topic from K&B book then you can also try TMH Java Complete Reference. That may prove helpful
 
Abhinav Trivedi
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is K&B actually ?
 
Ankit Garg
Sheriff
Posts: 9497
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K&B stands for SCJP Study Guide by Kathy Sierra and Bert Bates...
 
sebastian tortschanoff
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 823
Chrome Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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('');
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic