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

How do you use a pointer to a function?

0 Answers  


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

0 Answers  


What's a good way to check for "close enough" floating-point equality?

0 Answers   Celstream,


Explain the difference between exit() and _exit() function?

0 Answers  


what is c programing

11 Answers   Wipro,






Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 1. Print only the alphabets . If in upper case print in lower case vice versa.

1 Answers  


DIFFERNCE BETWEEN THE C++ AND C LANGUAGE?

2 Answers   Wipro,


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

0 Answers   L&T,


What is Your Name :)

1 Answers  


write a program that will read the temperature in Celsius and convert that into Fahrenheit.

1 Answers  


WHAT IS ABSTRACT DATA TYPE

4 Answers   Wipro,


What is sizeof return in c?

0 Answers  


Categories