SHOW:
|
|
- or go back to the newest paste.
| 1 | public class Class1 {
| |
| 2 | String str = new String; | |
| 3 | - | public String str2; |
| 3 | + | public String method1(){
|
| 4 | - | public void method1(){
|
| 4 | + | String str2 = "qwerty"; |
| 5 | - | str2 = "qwerty"; |
| 5 | + | return str2; |
| 6 | } | |
| 7 | } | |
| 8 | //========================================================= | |
| 9 | ||
| 10 | ||
| 11 | public class Class2 implements ActionListener{
| |
| 12 | //----- | |
| 13 | Class1 parent; | |
| 14 | Run (Class1 parent){
| |
| 15 | this.parent = parent; | |
| 16 | } | |
| 17 | //----- | |
| 18 | public void actionPerformed(ActionEvent e){
| |
| 19 | - | System.out.println(parent.str2); |
| 19 | + | System.out.println(parent.method1()); |
| 20 | } |