Object-oriented programming (OOPs) Question:
Download Job Interview Questions and Answers PDF
Default Access modifiers in C#?
Answer:
An enum has default modifier as public
A class has default modifiers as private . It can declare members (methods etc) with following access modifiers:
public
protected
internal
private
protected internal
An interface has default modifier as public
A struct has default modifier as private and it can declare its members (methods etc) with following access modifiers:
public
internal
private
A class has default modifiers as private . It can declare members (methods etc) with following access modifiers:
public
protected
internal
private
protected internal
An interface has default modifier as public
A struct has default modifier as private and it can declare its members (methods etc) with following access modifiers:
public
internal
private
Download OOP Interview Questions And Answers
PDF
Previous Question | Next Question |
What is Overriding? | Can we specify the access modifier for explicitly implemented interface method? |