Created
October 3, 2014 01:44
-
-
Save BrainKu/e98c1bc5f109eef61744 to your computer and use it in GitHub Desktop.
something about private
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 AB { | |
| private int ab = 1; | |
| public AB() { | |
| System.out.println(this.getClass().getSimpleName()); | |
| System.out.println(this.ab); | |
| System.out.println(((ABC)this).ab); | |
| } | |
| } | |
| class ABC extends AB { | |
| public int ab = 100; | |
| public ABC() { | |
| System.out.println(ab); | |
| } | |
| public static void main(String[] args) { | |
| new ABC(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment