Explain the differences between public, protected, private
and internal.
Answer Posted / 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 View All Answers
What is the purpose of type declarations?
how to count no of words,characters,lines in a paragraph.
Explain the process of converting a Tree into a Binary Tree.
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
What are the valid places to have keyword “break”?
What are volatile variables in c?
If the size of int data type is two bytes, what is the range of signed int data type?
What is difference between structure and union with example?
How will you write a code for accessing the length of an array without assigning it to another variable?
Can a pointer be static?
what is stack , heap ,code segment,and data segment
How do you write a program which produces its own source code as output?
what is the structure pointer?
How can I open files mentioned on the command line, and parse option flags?
What is the difference between exit() and _exit() function in c?