HI ,
Use of Wrapper Class:
1) To Represent the Primitive Data-Types in the Form of their Equivalent Objects.
Example1:
int i = 10; How to Represent this in it's Equivalent Object.
Integer x = new Integer(i);
another Example2 :
int i = 50;
String s1 = i +"";
Integer x = new Integer(s1);
Wrapper Classes have Two Constructors as Arguments .
Argument 1) Take Primitive Data Type as Argument -- > Example 1
Argument 2) Take String class Object of Primitive Data Type-->Example 2.
Constructor with Zero Constructor is Not Defined for Wrapper Classes.
No comments:
Post a Comment