-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWrapperClassMain.java
More file actions
36 lines (25 loc) · 1.11 KB
/
Copy pathWrapperClassMain.java
File metadata and controls
36 lines (25 loc) · 1.11 KB
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
30
31
32
33
34
35
36
package lang.wrapper;
public class WrapperClassMain {
public static void main(String[] args) {
Integer newInteger = new Integer(10);
Integer integerObj = Integer.valueOf(10);
Long longObj = Long.valueOf(100);
Double doubleObj = Double.valueOf(10.5);
System.out.println("newInteger = " + newInteger);
System.out.println("integerObj = " + integerObj);
System.out.println("longObj = " + longObj);
System.out.println("doubleObj = " + doubleObj);
System.out.println();
System.out.println("내부 값 읽기");
int intValue = integerObj.intValue();
long longValue = longObj.longValue();
double doubleValue = doubleObj.doubleValue();
System.out.println("intValue = " + intValue);
System.out.println("longValue = " + longValue);
System.out.println("doubleValue = " + doubleValue);
System.out.println();
System.out.println("비교");
System.out.println("==: " + (newInteger == integerObj));
System.out.println("equals: " + (newInteger.equals(integerObj)));
}
}