Why can?t you specify the accessibility modifier for methods
inside the interface?
Answers were Sorted based on User's Feedback
Answer / tsahi
Interfaces are designed to make sure a class which
implements them exposes a certain set of methods. Because
these methods are exposed, they must be public. therefore,
there is no point in implementing a method from an interface
which will be anything other than public. So all methods in
an interface are always public.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / umesh
They all must be public. Therefore, to prevent you from
getting the false impression that you have any freedom of
choice, you are not allowed to specify any accessibility,
it?s public by default.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / lakshmi
Methods that implement an interface must be declared public. The reason for this is that methods are implicitly public within an interface, so their implementation must also public. Also the return type and signature of the implementing method must match exactly the return type and signature specified in the interface definition.
| Is This Answer Correct ? | 0 Yes | 0 No |
what is default accessibility for a class? what is difference b/w viewstate and controlstate? what is the default access specifier for a top level class which are not nested into other classes?
Is goto statement supported in c#?
how encapsulation is implemented in c#
In dynamic link library, which api is used for load library?
Explain the use of Mutex in C#?
0 Answers Sans Pareil IT Services,
What is the xml document structure?
What are async and await?
Why c# is type safe?
What is the difference between namespace and class in c#?
What is difference between mutable and immutable in c#?
What is null propagation c#?
How do you inherit from a class in C#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)