what is boxing or unboxing and what is the uses of it in java language, ?
Virtual Position Forum :: Members Lounge :: Sciences & Knowledge :: Programing and Design :: Java Forum
Page 1 of 1 • Share
what is boxing or unboxing and what is the uses of it in java language, ?
Boxing & unboxing is the process of converting a primitive value into an object oriented wrapper class (boxing), or converting a value from an object oriented wrapper class back to the primitive value (unboxing).
Java 5 supports automatic conversion of primitive types (int, float, double etc.) to their object equivalents (Integer, Float, Double,…) in assignments, method and constructor invocations. This conversion is know as autoboxing.
Java 5 also supports automatic unboxing, where wrapper types are automatically converted into their primitive equivalents if needed for assignments or method or constructor invocations.For example:
int inative =0;
inative = new Integer(5); // auto-unboxing
Integer intObject =5 ; // autoboxing
Java 5 supports automatic conversion of primitive types (int, float, double etc.) to their object equivalents (Integer, Float, Double,…) in assignments, method and constructor invocations. This conversion is know as autoboxing.
Java 5 also supports automatic unboxing, where wrapper types are automatically converted into their primitive equivalents if needed for assignments or method or constructor invocations.For example:
int inative =0;
inative = new Integer(5); // auto-unboxing
Integer intObject =5 ; // autoboxing
WikiLeaks- Monstars
- Posts : 26
Join date : 2011-05-29
Similar topics
» Java is to Write Once Run Anywhere thats what java language
» Java is a beautiful language, but on web there are few web sites
» Java Tutorials For Beginners (From Basic to Advanced Level) Read more: Java Tutorial
» What is difference b/w java Buzzwords and java Keywords?
» what is difference b/w Java and Java Script?
» Java is a beautiful language, but on web there are few web sites
» Java Tutorials For Beginners (From Basic to Advanced Level) Read more: Java Tutorial
» What is difference b/w java Buzzwords and java Keywords?
» what is difference b/w Java and Java Script?
Virtual Position Forum :: Members Lounge :: Sciences & Knowledge :: Programing and Design :: Java Forum
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Yesterday at 9:57 am by Ibad Khan Buledi
» house disrepair claims
Mon Apr 22, 2024 11:23 am by Joshuaadam
» Aloha Planner - Note-Taker
Thu Apr 11, 2024 4:52 pm by ali001
» Streaming Guide Film TV Series
Tue Apr 09, 2024 9:39 pm by ali001
» Apricot Tree Problems & Solutions ????|خوبانی کے پھل کو کیڑا لگنےسے بچانے کا طریقہ ????
Sun Apr 07, 2024 6:28 am by Zamaan Khan
» خوبانی کے پودے کی کاشت گرم علاقوں میں کرنی چاہیے یا نہی
Sun Apr 07, 2024 6:24 am by Zamaan Khan
» New Here
Sun Apr 07, 2024 6:15 am by Zamaan Khan
» Bajta Hua Sochoon Main Koi Saaz Na Aaye Naat
Sun Apr 07, 2024 6:14 am by Zamaan Khan
» Woh Pagal Si Episode 52 to 62 - Top Pakistani Drama
Sun Apr 07, 2024 6:06 am by Zamaan Khan