Explain the differences between public, protected, private
and internal.

Answers were Sorted based on User's Feedback



Explain the differences between public, protected, private and internal...

Answer / avinash

public means we can access the code or data in public that
is visible to others.
protected means the code or data can be within the system
and,or it has no access to it.and it is not available.
private means it can be accessesed only by the person who
has the access or key to it.

Is This Answer Correct ?    1 Yes 0 No

Explain the differences between public, protected, private and internal...

Answer / rahul_kumar007

public:-
--------- It means we can access the property of public;
directly from out side of the class.

private:-
---------- it means we can't access the property of
private;
directly from out side the class.
and we can't intilizing the member var during run time
we have to use constuctor.
proctected:-
If we wnat to inherit private data member only onces.
then we make them protcted

Is This Answer Correct ?    10 Yes 11 No

Post New Answer

More C Interview Questions

Why & is used in scanf in c?

0 Answers  


Explain pointers in c programming?

0 Answers  


When is the “void” keyword used in a function?

1 Answers  


what is software?

7 Answers   Wipro,


What oops means?

0 Answers  






Taking an example,differentiate b/w loader and linker ?

1 Answers  


12344321 123 321 12 21 1 1 how i print this program??

5 Answers   DSR Management, Winit,


Explain what are reserved words?

0 Answers  


What is period operator in c?

3 Answers   Wipro,


Why pointers are used in c?

0 Answers  


what is the difference between #include<stdio.h> and #include "stdio.h" ?

3 Answers  


void main() { int a=1; printf("%d %d %d",a,++a,a++); } the output is supposed to be 1 2 2....but it is 3 3 1 this is due to calling conventions of C. if anyone can explain me how it happens?

7 Answers  


Categories