Last active
September 26, 2018 10:13
-
-
Save artem-smotrakov/b520bea1b807529edf1d6c4948025e85 to your computer and use it in GitHub Desktop.
Nested classes in Java, see also https://blog.gypsyengineer.com/en/security/whats-new-security-features-in-java-11.html
This file contains 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
package com.gypsyengineer.innerclass.field; | |
public class Outer { | |
private int secret = 10; | |
public void check() { | |
if (secret < 0) { | |
System.out.println("Oops"); | |
} else { | |
System.out.println("Okay"); | |
} | |
} | |
public class Inner { | |
public void go() { | |
secret = 42; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment