Guest User

Untitled

a guest
Mar 18th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Class1 {
  2.     String str = new String;
  3.     public String method1(){
  4.         String 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.method1());
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment