forked from kangjianwei/LearningJDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Entry.java
41 lines (32 loc) · 1.15 KB
/
Entry.java
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
37
38
39
40
41
package test.kang.unsafe;
import java.util.Arrays;
import sun.misc.Unsafe;
public class Entry {
public Unsafe unsafe = UnsafeUtil.getUnsafeInstance();
private static boolean booConst = false; // 常量
private String strVar = "唐僧";
private char[] charArray = new char[]{'东','土','大', '唐'};
private int intVar = 123;
private double doubleVar = 1.23;
public Entry() {
}
public Entry(String strVar, char[] charArray, int intVar, double doubleVar) {
this.strVar = strVar;
this.charArray = charArray;
this.intVar = intVar;
this.doubleVar = doubleVar;
}
@Override
public String toString() {
return "Entry{" + "strVar='" + strVar + '\'' + ", charArray=" + Arrays.toString(charArray) + ", intVar=" + intVar + ", doubleVar=" + doubleVar + '}';
}
public void setInfo(String strVar, char[] charArray, int intVar, double doubleVar) {
this.strVar = strVar;
this.charArray = charArray;
this.intVar = intVar;
this.doubleVar = doubleVar;
}
public char[] getCharArray() {
return charArray;
}
}