On 9/9/2014 2:15 PM, holger doepke wrote:
Sang says...
String class is a special (and only) class you can create an
instance without using new keyword...
example given
String str2 = "Hello world!";
Surely this statement is not correct as
Integer intInstance3 = 5;
is creating an instance of the Integer class without using new keyword
Good question. What happens above is called boxing and unboxing
feature (introduced from Java SE 5), in which the compiler adds code
below for you
Integer intInstance3 = new Integer(5);
-Sang
--
You received this message because you are subscribed to the Google
Groups "JPassion.com: Java Programming" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/jpassion_java.
For more options, visit https://groups.google.com/d/optout.
--
-------------------------------------------------------------------
Sang Shin, [email protected]
Founder and Chief Instructor of JPassion.com (JavaPassion.com)
http://www.linkedin.com/in/javapassion (Linkedin)
http://twitter.com/javapassion (Tweeter)
Life is worth living... with Passion!
Practically Free 3 to 5 days Live, Hands-on, Online Codecamps on
Java, HTML5, Ruby/Rails, Grails, JavaScript/jQuery, Spring, Android
http://jpassion.com/codecamps
----------------------------------------------------------------------
--
You received this message because you are subscribed to the Google Groups
"JPassion.com: Java Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/jpassion_java.
For more options, visit https://groups.google.com/d/optout.