Create an Integer object : Primitive Data Type « Data Type « Java
- Java
- Data Type
- Primitive Data Type
Create an Integer object
public class Main {
public static void main(String[] args) {
Integer intObj1 = new Integer(10);
Integer intObj2 = new Integer("10");
System.out.println(intObj1);
System.out.println(intObj2);
}
}
Related examples in the same category