answersLogoWhite

0

A private variable is only accessible in the class where it was declared

A protected variable is accessible to sub classes and classes in the same package as where they were declared

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

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.


Difference between private and protected specifier in c plus plus language?

In C++, the private specifier means that the item can only be accessed by methods of the class, not including methods of derived classes. Protected, on the other hand, means the item can be accessed by methods of the class, and methods of derived classes. Public, to complete the explanation, means that the item can be acessed by any method, this class, another class, or otherwise.


What is the difference between a system and a subsystem?

explain the difference between systems and sub systems


Difference between single-point cutting tool use in lathe and shaping machine?

explain the difference between single point & multi point cutting tool


What is the major difference between noncombustible construction and fire resistive construction?

Basically non combustible and fire resistive are the same. Difference is non combustible has steel frame members that are unprotected or limited protected. Fire resistive has protected steel frame members with a fire rated material such as concrete.

Related Questions

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 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.


How do you explain the difference between the vassals and serfs?

Explain the difference between the vassals and the serfs


Explain the difference between young and mature mountains?

Explain the difference between young and mature mountains?


Difference between private and protected specifier in c plus plus language?

In C++, the private specifier means that the item can only be accessed by methods of the class, not including methods of derived classes. Protected, on the other hand, means the item can be accessed by methods of the class, and methods of derived classes. Public, to complete the explanation, means that the item can be acessed by any method, this class, another class, or otherwise.


What is the difference between describe and explain?

Describe is what it is and explain is why it is as it is


What is difference between explain and describe?

Describe is what it is and explain is why it is as it is


Explain the difference between a cash and credit transaction for purchass and sales?

explain the difference between cash and credit transaction


Explain the difference between share of customer and customer equity.?

Explain the difference between share of customer and customer equity


What is the difference between a system and a subsystem?

explain the difference between systems and sub systems


Explain the difference betwwen the two types of feeding?

explain the difference between the two types of feeding?


Explain the difference between batch processing and real-time processing?

explain the difference between batch processing and real-time processing