Java Non Access Modifiers
An access modifier specifies how any class can access a given class and its fields, constructors, and methods within and different packages Class, fields, constructors, and methods can have one of four different Java access modifiers Private PublicIn Java, access modifiers are used to set the accessibility (visibility) of classes, interfaces, variables, methods, constructors, data members, and the setter methods For example, class Animal { public void method1() {} private void method2() {} } In the above example, we have declared 2 methods method1 () and method2 ()