Thursday, October 7, 2010

Wrapper Class in Java

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:

AWS certification question

AWS AWS Hi! this is for questions related to AWS questions. EC2 instances EC2 storage types cold HDD : 1. Defines performance in terms...