answersLogoWhite

0

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.

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What is an inheritance Explain different types of inheritance in c?

C is not an object oriented language and therefore has no native support for inheritance.


Class hierarchy is a fundamental concept of object oriented programs explain what this term means with reference to inheritance abstraction and instantiation?

Class hierarchy is a term used in Java. It is used for identifying the inheritance hierarchy or the parent class relationships Ex: Public class B extends C { } Public class A extends B { } Here if we take the class hierarchy for class 'A' it would be A


Explain types of inheritance in c plus plus?

There are essentially just two types of inheritance: single inheritance and multiple inheritance. Single inheritance simply means that one class derives directly from another class. Multiple inheritance means one class is directly derived from two or more classes. However, since base classes can (and often are) be derived from other base classes, you can think of this type of inheritance as being multi-level. In addition, two or more base classes that share a common base class can use virtual inheritance. What this means is that the common base class becomes a direct base class of the most-derived class, and this one instance is shared, virtually, by all the base classes that would otherwise inherit directly from it. in other words, there is only one instance of the common base class, rather than one instance per class that inherits from it. This is useful in the so-called "dreaded diamond" formation, where a derived class inherits from two base classes, both of which inherit from a common base class.


Explain the difference between public and protected access specifier?

A private variable is only accessible in the class where it was declaredA protected variable is accessible to sub classes and classes in the same package as where they were declared


Explain the different types of constants n variables in C?

explain loop structrunes

Related Questions

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


What is an inheritance Explain different types of inheritance in c?

C is not an object oriented language and therefore has no native support for inheritance.


Explain different types of inheritance of object oriented programming?

== ==


Explain the significance of limited liability to sole trader and partnership?

Type Explain the significance of limited liability to sole trader


How did the work of Mendel help explain inheritance of traits?

because of punjabi


How do you explain the working of Letter of Credit?

Explain the significance of letter of credit in international marketing?


What is the likely mechanism of inheritance for a character with a large range of phenotypes Explain?

mech and cromosomes


Explain the historical significance of Louis Armstrong?

ask him


What are the significance of taking financial decisions in firms?

. Explain the significance of making financial decision by corporate organizations


How do you explain why operations management has assumed great significance in modern industries?

Explain the significations of Operations management?


How do you explain a significance of this quote in historical contex?

you cant it is imposible


Can you explain the significance of his nobs in the context of the story"?

In the story, the significance of his nobs represents his status and power within the society.