Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Java Wrapper Classes

Integer number = new Integer(77);//int
Integer number2 = new Integer("77");//String
Float number3 = new Float(77.0);//double argument
Float number4 = new Float(77.0f);//float argument
Float number5 = new Float("77.0f");//String
Character c1 = new Character('S');//Only char constructor
Character c2 = new Character(1234);//COMPILER ERROR
Boolean b = new Boolean(true);//value stored - true
Source by www.scaler.com #
 
PREVIOUS NEXT
Tagged: #Java #Wrapper #Classes
ADD COMMENT
Topic
Name
3+2 =