java inner class
#java #inner #classes
public class Main {
public static void main(String[] args) {
/* inner class = A class inside of another class.
useful if a class should be limited in scope.
usually private, but not necessary
helps group classes that belong together
extremely useful for listeners for specific events
precursor for anonymous inner classes
*/
Outside out = new Outside();
Outside.Inside in = out.new Inside();
in.Greeting();
}
//**********************************************************
public class Outside {
String x = "Hello ";
public class Inside{
String y = "World!";
public void Greeting()
{
System.out.println(x+y);
}
}
}
On this page of the site you can watch the video online Java inner classes 👩🏫 with a duration of hours minute second in good quality, which was uploaded by the user Bro Code 13 June 2020, share the link with friends and acquaintances, this video has already been watched 25,777 times on youtube and it was liked by 1.3 thousand viewers. Enjoy your viewing!