Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Interview Questions
Does accessibilty modifier implies on interfaces?
Posted By :
Posted Date :
July 31, 2011
No, all the elements of interface should be public
You can also find related Interview Question to
Does accessibilty modifier implies on interfaces?
why cant we specify the accesibility modifier for methods inside the interface?
They all are public
What is the differences between delegates and interfaces?
Interfaces carry semantics, and when a programmer implements an interface, he is typically well aware of that semantics. When you try to invoke a particular method via an interface, you can be fairly certain that if you succeed, the semantics of that method is what you expect. For that reason, using interfaces is essentially doing a check for semantic correctness on some level.
Delegates, on the other hand, by only verifying the method signature, make the programmer responsible for ensuring that the semantics of the method is compatible. The semantics may cover not only the meaning of the arguments and return value (some times even the order of the arguments if they are of the same type), the ranges of the arguments, but also an invocation order when multiple methods are concerned. Hence, in a sufficiently large program there is plenty of margin to make an error when different programmers are not forced to comply with a uniform semantics (as they would be if interfaces were used).
What is a modifier?
A modifier, also called a modifying function is a member function that changes the value of at least one data member. In other words, an operation that modifies the state of an object. Modifiers are also known as 'mutators'.
Describe the accessibility modifier protected internal.
It's available to derived classes and classes within the same Assembly.
What is the scope of the access modifier Protected Internal?
We can access with in the project and also in the derived project
can we impliment multiple inheritance by using interfaces in C#.net?
yes we can implement:
Inheritance Usage Example:
Here is a syntax example for using Implementation Inheritance.
derivedClass is derived from baseClass.
Interface Inheritance example:
private Class derivedClass:baseClass , InterfaceX , InterfaceY ....
Techunique Solutions is designing a website for a Goodways travels. One of the requirements given to the design team is that the website should handle the requirements of the employees of Techunique, travel agents and direct customers separately. Apart from that, the website should give information related to the new holiday packages announced by Goodways. The design team has decided to create separate interfaces for these three types of users. Peter Williams, one of the members of the design team, has been given the task to identify the home page strategy for the website. Which of the following home page strategies should Peter select for the travel website?
1, Splash home page
2, Menu home page
3, Path-based home page
4, News-oriented home page
Answer : 3
suppose two interfaces have same method, so how will you implement these methods in derive class?
by using interface name
Why can't you specify the accessibility modifier for methods inside the interface
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.
Why can't you specify the accessibility modifier for methods inside the interface?
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.
which of the following statements is not true for interfaces
A) Interface definitions does not have implementation
B) Interfaces must be declared as public
C) Interfaces can be instantiated
D) Interface does not have constructors
Explanation: Interfaces can only be implemented by inheriting and they can not be instantiated
What is the difference between abstract class and interfaces?
1) Concrete methods are applicable to abstract class only, interface cannot use them.
2)Abstract class uses inheritance while interface does not use inheritance.
properties and methods of classes, but unlike classes, do not provide implementations. The Interface statement allows you to declare interfaces, while the Implements statement lets you write code that puts the items described in the interface into practice.
Is it possible to modify an abstract class with sealed Modifier?
no, Because the two modifier have opposite meanings.
Quick Links For Interview Questions Categories:
Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.
So, Start looking our
section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.
Hall of Fame
Terms of Service
Tell A Friend