-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB.java
More file actions
34 lines (30 loc) · 655 Bytes
/
Copy pathB.java
File metadata and controls
34 lines (30 loc) · 655 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
30
31
32
33
34
package src.thinkinginjava.InnerClass10;
/**
* Created by Ryan on 2017/2/5.
*/
public class B {
private U[] u = new U[5];
public void saveU(U utem, int i) {
u[i] = utem;
}
public void setU() {
u = null;
}
public void print() {
for(U allu: u) {
System.out.print(allu);
}
}
public static void main(String[] args) {
A a = new A();
B b = new B();
b.saveU(a.test(), 0);
b.saveU(a.test(), 1);
b.saveU(a.test(), 2);
b.saveU(a.test(), 3);
b.saveU(a.test(), 4);
b.print();
b.setU();
b.print();
}
}