can we declare local inner class as private?
No, local inner class cannot be declared as private or protected or public because local inner class is not associated with Object. Example of local inner class public class Main{ private String website="826.a00.myftpupload.com"; void show(){ class LocalInnerClass{ void display(){ System.out.println(website); } } LocalInnerClass localInnerClass = new LocalInnerClass(); localInnerClass.display(); } public static void main(String args[]){ Main … Read more