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

What are the application of c?

0 Answers  


proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output?

7 Answers   Hughes,


64/square(4)

1 Answers  


how to display 2-D array elements in spiral

2 Answers  


What is the total generic pointer type?

0 Answers  






What does printf does?

0 Answers  


program to convert a integer to string in c language'

0 Answers  


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

0 Answers  


Write a program to check prime number in c programming?

0 Answers  


du u know test pattern for robosoft? Plz share

1 Answers   RoboSoft, TATA, Wipro,


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

0 Answers  


Which command is more efficient? *(ptr+1) or ptr[1]

3 Answers  


Categories