Ce diaporama a bien été signalé.
Le téléchargement de votre SlideShare est en cours. ×

Explain the difference between private and proctected members of a cla.docx

Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité

Consultez-les par la suite

1 sur 1 Publicité

Explain the difference between private and proctected members of a cla.docx

Télécharger pour lire hors ligne

Explain the difference between private and proctected members of a class.
Solution
Hi, I am explaning difference between private and public in context of Java Programing Language(since you have not mentioned any Programing Language).
private : Members marked private can not be accessed by code in any class other than the class in which the priavte member was declared.
- A private member is invisible to any code outside the member\'s own class.
- When a member(function) is declared private, a subclass can not inherit it.
protected :  Members marked protected can be accessed by a subclass(child class) even if the subclass is in a different package.
.

Explain the difference between private and proctected members of a class.
Solution
Hi, I am explaning difference between private and public in context of Java Programing Language(since you have not mentioned any Programing Language).
private : Members marked private can not be accessed by code in any class other than the class in which the priavte member was declared.
- A private member is invisible to any code outside the member\'s own class.
- When a member(function) is declared private, a subclass can not inherit it.
protected :  Members marked protected can be accessed by a subclass(child class) even if the subclass is in a different package.
.

Publicité
Publicité

Plus De Contenu Connexe

Plus par rtodd432 (20)

Plus récents (20)

Publicité

Explain the difference between private and proctected members of a cla.docx

  1. 1. Explain the difference between private and proctected members of a class. Solution Hi, I am explaning difference between private and public in context of Java Programing Language(since you have not mentioned any Programing Language). private : Members marked private can not be accessed by code in any class other than the class in which the priavte member was declared. - A private member is invisible to any code outside the member's own class. - When a member(function) is declared private, a subclass can not inherit it. protected :Â Â Members marked protected can be accessed by a subclass(child class) even if the subclass is in a different package.

×