Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
Do you mean how to call the display method? I am not sure but I think the only way would be to create an object of Demo inside inner () method: static void inner { //your Demo class Demo d = new Demo(); d.display(); inside your main method: inner(); if you call inner() it will also call display().
2nd Sep 2019, 6:15 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
display () is already declared in the demo class as void display() + there are typo in: Class A Static void inner(){
2nd Sep 2019, 6:33 PM
zemiak