Skip to content

Instantly share code, notes, and snippets.

@LaurentiuGabriel
Created August 17, 2020 18:10
Show Gist options
  • Select an option

  • Save LaurentiuGabriel/c317bb00b9cb4fd1fa83619d1dbebda6 to your computer and use it in GitHub Desktop.

Select an option

Save LaurentiuGabriel/c317bb00b9cb4fd1fa83619d1dbebda6 to your computer and use it in GitHub Desktop.
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