O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

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

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio

Confira estes a seguir

1 de 1 Anúncio

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

Baixar para ler offline

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

Anúncio
Anúncio

Mais Conteúdo rRelacionado

Mais de rtodd432 (20)

Mais recentes (20)

Anúncio

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.

×