51.Ststic_nested_class
// Ststic_nested_class
class outter
{
static void display()
{
System.out.println("display method of outter class");
}
static class inner
{
void show()
{
System.out.println("show method of inner class");
}
}
}
class Ststic_nested_class
{
public static void main(String[] args) {
outter.display();
outter.inner obj_inner = new outter.inner(); //differnt in non-static
obj_inner.show();
}
}
OUTPUT:
display method of outter class
show method of inner class
Comments
Post a Comment