-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcombinedTable.java
More file actions
35 lines (33 loc) · 854 Bytes
/
combinedTable.java
File metadata and controls
35 lines (33 loc) · 854 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
35
public class combinedTable{
public static void main(String[] args) {
singleTable OUTTER = new singleTable();
System.out.println(OUTTER.getTestText());
OUTTER.setTestText("OUTSIDE");
System.out.println(OUTTER.getTestText());
combine combineA = new combine(OUTTER);
combineA.printA();
OUTTER.setTestText("Test change");
combineA.printA();
}
}
class combine{
private singleTable A;
public combine(singleTable A){
this.A = A;
}
public void printA(){
System.out.println(A.getTestText());
}
}
class singleTable{
private String test = "Initial";
public singleTable(){
test = "Constructor";
}
public void setTestText(String text){
test = text;
}
public String getTestText(){
return test;
}
}