answersLogoWhite

0

What do you mean access specifier?

Updated: 8/19/2019
User Avatar

Wiki User

12y ago

Best Answer

An Access Modifier is a key word in java that determines what level of access or visibility a particular java variable/method or class has. There are 4 basic access modifiers in java. They are:

1. Public

2. Protected

3. Default and

4. Private

Private is the most restrictive access modifier whereas public is the least restrictive. Default is the access protection you get when you do not specifically mention an access modifier to be used for a java object.

Java programming does not run by just a single piece of class that has the whole functionality. You have hundreds of classes that interact with one another, passing data between them and returning output to the user of the system. So it is very important for members of one class to access members of another. Here members may refer to variables, methods and even classes. So, this is where the access modifiers come into picture. The modifier associated with every member of the class determines what level of visibility that member has.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What do you mean access specifier?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What do you mean by access specifier in c?

There are no access specifiers in C. All functions and data are public.


What is an access specifier?

An access specifier is a keyword applied to a variable, or method, which indicates which parts of the program are permitted to access it.


What is an access specifier do?

There is no such thing as an access specifier in Java. There are access modifiers. They specify the access level of the item they modify: public, private, protected.


What is the difference between access specifier and access modifier?

An access modifier is another name for an access specifier, which in object-orientated software is a keyword applied to a variable which indicates which other parts of the programme are permitted to access it.


What is the use of public access specifier?

use of public access specifier iswe can access the class members(methods,variables) out side the class using class reference


What is a default access specifier for variable in c sharp?

Default access specifier in c# is private. if you don't specify it automaticaly takes it as private.


Where do you define the access specifier for a java method properties?

We define the access specifier of a function at the place of its method signature(The place we write the method's name).for example,public void sample(){}here "public" is the access specifier of function name-sample.


Which is public to all access class or struct or function or variable?

The default access specifier for a class is private. The default access specifier for a struct is public. It does not matter if it is a function or a variable.


How the jvm is able to access your class even you declare it using default access specifier but the same class is not accessed from other class which is declared in another package?

The JVM knows about all of your classes, no matter what package they are in or what access specifier you declared them with. The access specifier is only used to limit access from other classes.


What is the default access specifier in java?

There is no such thing as an access specifier in Java. There are access modifiers.The default access modifier if unspecified is to allow access to classes in the current package only, except within an interface where the default is 'public'


What is the default access specifier of Java?

There is no such thing as an access specifier in Java. There are access modifiers.The default access modifier if unspecified is to allow access to classes in the current package only, except within an interface where the default is 'public'.


Default access specifier in java?

There is no such thing as an access specifier in Java. There are access modifiers.The default access modifier if unspecified is to allow access to classes in the current package only, except within an interface where the default is 'public'.