answersLogoWhite

0

Visibility is another term used for Acess Specifiers for java variables and objects.

One of the techniques in object-oriented programming is encapsulation. It concerns the hiding of data in a class and making them available only through its methods. In this way the chance of making accidental mistakes in changing values is minimized. Java allows you to control access to classes, methods, and fields via so-called access specifiers. The access to classes, constructors, methods and fields are regulated using access modifiers i.e. a class can control what information or data can be accessible by other classes. To take advantage of encapsulation, you should minimize access whenever possible.

Java provides a number of access modifiers to help you set the level of access you want for classes as well as the fields, methods and constructors in your classes. A member has package or default accessibility when no accessibility modifier is specified.

Access Modifiers

1. Private

2. Protected

3. Default

4. Public

Public is the most liberal access specifier and Private is the most restrictive access specifier.

User Avatar

Wiki User

16y ago

Still curious? Ask our experts.

Chat with our AI personalities

RossRoss
Every question is just a happy little opportunity.
Chat with Ross
TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga
MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine
More answers

Visibility Control is achieved in Java by using Access Modifiers.

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.

User Avatar

Wiki User

14y ago
User Avatar

Visibility Control in java is accomplished through access modifiers. 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

User Avatar

Wiki User

11y ago
User Avatar

Visibility control in Java is implemented using Access Modifiers. 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.

User Avatar

Wiki User

14y ago
User Avatar

Add your answer:

Earn +20 pts
Q: Discuss about the visibility control of java program?
Write your answer...
Submit
Still have questions?
magnify glass
imp