Why can?t you specify the accessibility modifier for
methods inside the interface?
Answer Posted / karans
All members of an interface is marked as public because :
1) If Private :- The members ca not be implemented into
child class (as private members are derived into child
class).
2). If Protected :- The members can not be accessed by
instance of the class implementing members of that
interface (as protected members become private into
inherited class) even the members will not be inherited
into other child classes of class implementing interface.
c). If Public :- The members can be implemented into
child classes and can be accessed by instances of that
class as well as can be inherited into child class of that
class.
So All the members of Interface are bydefault considered
as PUBLIC.
| Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
How do you name a variable in c#?
write code for inserting and updating recoards in sql server database using connected architecture & records shoulds displayed in grid view ( use c# )
How many types of constructors are available in c#?
Define delegation in .net?
Write the syntax for catching an exception in c#?
What are virtual classes in c#?
what is a structure in c#
What is a float?
What is c# used for in the industry?
What is a deadlock lock?
What is the difference between method parameters and method arguments. Give an example?
Is null empty or whitespace c#?
What is the .net datatype that allows the retrieval of data by a unique key?
What is default value of decimal c#?
What is the difference between User controls and Custom Controls?