-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChild.java
77 lines (54 loc) · 1.23 KB
/
Child.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
class Person {
private String name = "Person";
int age = 0;
}
class Chinese{
private static Chinese objref =new Chinese();
private Chinese(){}
public static Chinese getInstance() { return objref; }
}
interface IAction {
void fly();
}
class ActionImpl implements IAction {
public void fly() {}
}
public class Child extends Person {
public String grade;
public static void add(Byte b) {
b = b ++;
}
/**
public static synchronized void main(String[] a){
Thread t = new Thread(){
public void run(){
Sogou();
}
};
t.run();
System.out.print("Hello");
}
static synchronized void Sogou(){
System.out.print("Sogou");
}*/
public static void main(String[] args){
Chinese obj1 = Chinese.getInstance();
Chinese obj2 = Chinese.getInstance();
System.out.println(obj1 == obj2); //true
System.out.println("is" + 100 + 5); //is1005
System.out.println(100 + 5 + "is"); //105is
System.out.println("is "+ (100 + 5));//is105
}
/**
public static void main(String[] args) {
//Person p = new Child();
Byte a = 127;
Byte b = 127;
add(++a);
System.out.println(a + " ");
add(b);
System.out.println(b + " ");
Object a = true;
System.out.println(a);
}*/
}