Created
April 8, 2012 17:09
-
-
Save yasith/2338534 to your computer and use it in GitHub Desktop.
Variable Passing Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FrameOne extends JFrame{ | |
private void init(){ | |
FrameTwo f = new FrameTwo("Hi"); | |
f.setVisible(true); | |
} | |
//main method calls init. | |
} | |
class FrameTwo extends JFrame{ | |
private stringVar; | |
public FrameTwo(String s){ | |
super(); | |
stringVar = s; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment