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


Please Help Members By Posting Answers For Below Questions

Why pointers are used?

633


What is pre-emptive data structure and explain it with example?

3212


How many keywords (reserve words) are in c?

621


Give the rules for variable declaration?

678


What is the difference between mpi and openmp?

737






What are the application of void data type in c?

719


number of times a digit is present in a number

1544


What is structure pointer in c?

573


which is an algorithm for sorting in a growing Lexicographic order

1398


What is a function in c?

575


can we implement multi-threads in c.

670


Is main an identifier in c?

605


What is 2c dna?

608


Where register variables are stored in c?

553


Write a program to identify if a given binary tree is balanced or not.

688