- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram30_Wrapper.java
More file actions
Latest commit
19 lines (16 loc) · 642 Bytes
/
Copy pathProgram30_Wrapper.java
File metadata and controls
19 lines (16 loc) · 642 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Write a java program to perform autoboxing and unboxing using wrapper class.
// Date : 31/03/2024, Author : Yash Wadhvani
publicclassProgram30_Wrapper {
publicstaticvoidmain(String[] args) {
inta = 10;
System.out.println("Value of a = " + a);
Integeri = Integer.valueOf(a);
System.out.println("Object Value after autoboxing = " + i);
// Float f = Float.valueOf(a);
// System.out.println(f);
// String str = String.valueOf(a);
// System.out.println(str);
intb = i.intValue();
System.out.println("Primitive Value after unboxing = " + b);
}
}