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

Does a class need a constructor c#?

491


What is garbage collection? How to force garbage collector to run?

498


Can I use parseint?

488


What is Assembly. and Describe type of assembly. why most developer happy with private assembly.

581


How can we set the class to be inherited, but prevent the method from being over-ridden?

484






What is assembly c#?

477


What is use of a HashTable in .NET?

703


What do you mean by default constructor?

610


Can we inherit private members of class in c#?

583


What is the implicit name of the parameter that gets passed into the class set method?

494


What is the importance of closing an ado.net application?

482


What does return do in for loop?

484


What is the difference between protected and internal in c#?

468


Are c# generics the same as c++ templates?

499


What are handlers in c#?

501