Created
February 22, 2013 08:56
-
-
Save anton0xf/5011886 to your computer and use it in GitHub Desktop.
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
| public class Main { | |
| String variable; | |
| public static void main(String[] args) { | |
| System.out.println("Hello World!"); | |
| B b = new B(); | |
| } | |
| public Main(){ | |
| printVariable(); | |
| } | |
| protected void printVariable(){ | |
| variable = "variable is initialized in Main Class"; | |
| } | |
| } | |
| class B extends Main { | |
| String variable; | |
| public B(){ | |
| System.out.println("variable value = " + variable); | |
| } | |
| protected void printVariable(){ | |
| variable = "variable is initialized in B Class"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment