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

program to locate string with in a string with using strstr function

2 Answers   Huawei, Shreyas,


consider the following structure: struct num nam{ int no; char name[25]; }; struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}}; ..... ..... printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1); What does the above statement print? a.8,9 b.9,9 c.8,8 d.8,unpredictable value

4 Answers   TCS,


Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given

0 Answers   XYZ,


c programming of binary addition of two binary numbers

4 Answers  


What is a pointer?

1 Answers   ADP, IFFCO,






What is a stream in c programming?

0 Answers  


What are the types of data types and explain?

0 Answers  


What is wrong with this program statement?

0 Answers  


How can I write functions that take a variable number of arguments?

0 Answers  


Is void a keyword in c?

0 Answers  


Can math operations be performed on a void pointer?

0 Answers  


what does static variable mean?

0 Answers   TCS,


Categories