aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes question about wrapper objest Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "question about wrapper objest" Watch "question about wrapper objest" New topic
Author

question about wrapper objest

zhu weitao
Greenhorn

Joined: Sep 02, 2008
Posts: 9


What't the differences between "Integer a = 1;" and "Integer c = new Integer(1);"?

And,why the result of "System.out.println(c==d);" is "false"
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2896
    
    1

Discussed many times , search this forum or Java Beginner section , and this recent thread discussed your doubt !


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hi,

"==" tells whether references are refer to the same object or not.

Integer i=new Integer(1);
Integer j=new Integer(1);

the Bold case are different object right?

when you put something like this

Integer a=1,b=1; //the both references pointing 1 so true



 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: question about wrapper objest
 
Similar Threads
practice example for young tigers: mixing equailty and autoboxing
Var args question...
Wrapper Classes Autoboxing Concept
equals on array
Autoboxing / Unboxing doubt