answersLogoWhite

0


Best Answer

Three types of access specifier private , public ,protected

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the various access specifiers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Do you get Security by access specifiers in Java?

No, because there is no such thing as an access specifier in Java. There are access modifiers, and security is their entire purpose, so of course you get it when you use them.


Are the private access specifiers in Java and C plus plus the same?

No.In Java, the private access modifier restricts member access to the class in which the member is declared. But in C++, private members are also accessible to friends of the class in which they are declared. The rough equivalent in Java would be package private access.Not that Java doesn't have access specifiers, it has access modifiers. When no modifier is specified, default access is implied, which is package private for classes and public for interfaces.


Why the format specifiers are not used in cpp?

You might be wrong: printf and scanf are usable in C++ just as in C. With format specifiers.


Explain the significance of public and protected and private access specifiers in inheritance?

These are all access modifiers in Java. a. Public - these are accessible anywhere. This is the least restrictive access specifier. b. Private - these are accessible only inside the declaring class. This is the most restrictive access specifier. c. Protected - these are in between public and private. These are accessible to all classes that inherit this class d. Package - this is the default access specifier. These are accessible to all classes that are present in the same package as the contained class.


What is the explanation for the different access modifiers in Java?

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:PublicProtectedUnspecified (package-private)PrivateClasses can only be declared public or left unspecified (the "package-private" default level). Methods can be declared any of the above.See the Link on the Java Tutorial for a very good explanation of the various levels of access each modifier provides.

Related questions

What are the access specifiers in c?

Satya


What do you mean by access specifier in c?

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


Do you get Security by access specifiers in Java?

No, because there is no such thing as an access specifier in Java. There are access modifiers, and security is their entire purpose, so of course you get it when you use them.


What are different access specifiers in c sharp?

public private internal protected internal protected


Explain the different access storage specifiers available in c?

The storage class specifiers in C and C++ are:autoexternmutableregisterstatictypedefA storage class specifier is used to refine the declaration of a variable, a function, and parameters


Are the private access specifiers in Java and C plus plus the same?

No.In Java, the private access modifier restricts member access to the class in which the member is declared. But in C++, private members are also accessible to friends of the class in which they are declared. The rough equivalent in Java would be package private access.Not that Java doesn't have access specifiers, it has access modifiers. When no modifier is specified, default access is implied, which is package private for classes and public for interfaces.


What are the access control specifiers used in c plus plus?

The access control specifiers in C++ are...public - to denote that the member is accessible from any in scope codeprivate - to denote that the member is accessible only from within the containing classprotected - the same as private, except that derived classes are includedPrivate is the default for a class type object, while public is the default for a structure type object.


What is the need of using access specifiers?

To ensure that the variables and methods are used only by the necessary classes/methods. If we are going to declare a method or a variable public, it can be accessed by everybody thereby making it vulnerable to unwanted change by other classes. If we make it private, only that class can modify it and hence data is secure. The above is just a simple example of how useful access specifiers are in programming.


Why the format specifiers are not used in cpp?

You might be wrong: printf and scanf are usable in C++ just as in C. With format specifiers.


What are severity and course specifiers in dsm iv?

TAe


What group do DCL classifiers represent?

size and shape specifiers


What are the various techniques that are available to access and use the CAD software?

What are the various techniques that are available to access and use the CAD software?