What are the access-specifiers available in c#?

Answer Posted / vakil vijay vamangari

Public: With respect to the assembly the variable,methods of
public class can be access any where .

Private: This is default in c#.net.With respect to the
assembly the variable,methods of private class can be
access only with in that class only.

Protected: With respect to the assembly the variable,methods
of protected class can be access with in that class(base
class) and accessed in class which is derived from that
base class.

Internal(friend in vb.net): With respect to the assembly the
variable,methods of internal class can be access with in
that assembly not the outside of that assembly

Protected Internal: Protected + Internal
With with respect to the assembly the variable,methods
of this class can be access with in that assembly and
protected out side the assembly

Is This Answer Correct ?    4 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between hashtable and dictionary in c#?

475


Is c sharp and c# are same?

504


What is data types in c#?

519


Is a dll an assembly?

474


How to add controls dynamically to the form using c#.net.

469






What is the difference between hashtable and dictionary?

507


What is the difference between method parameters and method arguments. Give an example?

511


What is string empty?

499


What are value types in c#?

497


what is IDisposal interface,IComparable,IEquatable,IFormatable

528


Are private members inherited in c#?

562


What is an escape sequence in c#?

506


Can we have multiple constructors in a class c#?

497


What is uint64_t?

519


What is difference between .net and c#?

461