Skip to content

Instantly share code, notes, and snippets.

@yasith
Created April 8, 2012 17:09
Show Gist options
  • Save yasith/2338534 to your computer and use it in GitHub Desktop.
Save yasith/2338534 to your computer and use it in GitHub Desktop.
Variable Passing Example
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