Posts

Showing posts from 2015

Java Access Specifiers and Modifiers

Following information is always help you out for Java access specifiers :   Access specifiers, specify the access to our code for other classes – whether other classes can access or not and if permitted, to what extent they can access. Java includes access modifiers also which are quiet different from access specifiers. Here is the Java Standard Access Specifiers   1.Default 2.Public 3.Private 4.Protected All the access specifiers are Java keyword .and every access specifiers having its own accessibility propriety and thereby its should be written in lower-case only . 1. public Let us assume that the eat() method is public. If a member of a class is public 1. It can be accessed by the classes of the same package. That is, Lion of the same package can access it. 2. It can also be accessed by the classes of other packages also. That is, Peacock of other package also can access. public member of a class can be accessed by any class of any package as ever...