Created
August 17, 2020 18:10
-
-
Save LaurentiuGabriel/c317bb00b9cb4fd1fa83619d1dbebda6 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
| class OuterClass { | |
| void printMessage(){ | |
| System.out.println("This is the outer class!"); | |
| } | |
| class InnerClass { | |
| void print(){ | |
| System.out.println("This is the inner class!"); | |
| } | |
| } | |
| } | |
| public class MainClass { | |
| public static void main(String[] args) { | |
| OuterClass outerClass = new OuterClass(); | |
| OuterClass.InnerClass innerClass = outerClass.new InnerClass(); | |
| outerClass.printMessage(); | |
| innerClass.print(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment