• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Problem with Wrapper class.  RSS feed

 
Greenhorn
Posts: 11
  • 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.
 
Ranch Hand
Posts: 362
  • 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..

 
Ranch Hand
Posts: 68
  • 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...
 
Ranch Hand
Posts: 826
Chrome Eclipse IDE Oracle
  • 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
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is K&B actually ?
 
Sheriff
Posts: 9643
42
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 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
  • 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: 826
Chrome Eclipse IDE Oracle
  • 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
  • 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.
 
Greenhorn
Posts: 16
Hibernate Java Spring
  • 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('');
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!