-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWrapper Class
More file actions
29 lines (24 loc) · 923 Bytes
/
Wrapper Class
File metadata and controls
29 lines (24 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*wrapper class = provides a way to use primitive data types as reference data types
reference data types contain useful method
data can be used with collections (ex. ArrayList)
*/
// primitive //wrapper
//---------- //----------
//boolean Boolean
//char Character
//int Integer
//double Double
//autoboxing = the automatic conversion that the Java compiler makes between the primitive types and their corresponding obj
//unboxing = the reverse of autoboxing. Automatic conversion of wrapper class to primitive
public class Main {
public static void main(String[] args) {
Boolean a = true;
Character b ="@";
Integer c = 123;
Double d = 3.14;
String e = "Bro";
if(a==true){
System.out.println("This is true");
}
}
}