Total members 9946 | Gratitudes |It is currently Thu Feb 09, 2012 3:00 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Code Snippet
 Code subject: Boxing and unboxing make using wrapper classes
PostPosted: Sat Aug 29, 2009 2:36 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2103
Location: Earth
Has thanked: 39 time
Have thanks: 56 time

Code:
public class BoxingTest {
     public static void main(String args[])
     {
         // non auto boxing
         Integer x = new Integer(10);
         int y = x.intValue();
         System.out.println("Y = "+y);

         // auto boxing
         Integer z = new Integer(43);
         z++;
         System.out.println("z = "+z);


         Integer h = new Integer(44);
         System.out.println("h = "+h);

         // Comparing two refferences
         System.out.println("z == h "+(h == z ));


     }
}


_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 How to make PHP form data saved into txt file  PHP  Radu  6
 how do i create the classes XX and YY?  Java  Anonymous  0
 how to make an application in java for cell phone.  Java  AskBot  9
 make a game using flash  Macromedia Flash tutorials  msi_333  3
 make notepad editor in c  C-C++  rajesh25  3

All times are UTC [ DST ]


Users browsing similar codes

Users browsing this forum: No registered users and 2 guests



Jump to:  
Previous Code Snippet | Next Code Snippet 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team