.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

suppose two interfaces have same method, so how will you implement these methods in derive class?

Posted By :Syed Shakeer Hussain     Posted Date :September 19, 2010    Points :10   Category :.NET Framework 
by using interface name


You can also find related Interview Question to suppose two interfaces have same method, so how will you implement these methods in derive class?  below: 

Suppose you have created a WCF service. You have an interface stating your methods that must be exposed to the clients. But you have forgotten to specify "[OperationContract]" attribute in any of your method. What will happen ?

  
If you do not specify "[OperationContract] " in any of the methods in your interface then you will get the following error :-
IService1' has zero operations; a contract must have at least one operation



Here, Iservice is the name of my Interface. you can have your own name.
So, it is mandatory to label "[OperationContract] " attribute to at least one method while declaring your interface methods or ServiceContract.
(More...)

Can we call a base class method without creating instance?

  
Its possible If its a static method.

Its possible by inheriting from that class also.

Its possible from derived classes using base keyword. (More...)

How can I look up a parent class method or property of any System-level object?

  
Use the Class View window, accessed from the standard toolbar by clicking View | Class View. (More...)

Can you allow class to be inherited, but prevent the method from being over-ridden?

  
Yes, just leave the class public and make the method sealed. (More...)

Which method is used to serialize an object into an XML document from Xmlserializer class?

  
The "Serialize" method is the first step of serialize process and used to create an XML document (More...)

Name the Method of ServiceBase class?

  
The following are the methods of ServiceBase class.

· OnStart

· OnStop

· OnPause

· OnContinue

· OnShutdown

· OnPowerEvent

· OnCustomCommand (More...)

How can you access a private method of a class?

  
Use .Net Reflection. Using reflection we can invoke private methods too.

Example:

Car car = new Car();
Type type = car.GetType();
MethodInfo methodInfo = type.GetMethod("ShiftGearUp", BindingFlags.NonPublic | BindingFlags.Instance);
methodInfo.Invoke(car, null);

Pre: Create a class Car with private method "ShiftGearUp" (More...)

Why struct is not used to hold entity instead of class?

(eventhough struct provides us properties, methods and interface support)

  
Struct is a value type and
Class is a reference type.

Struct is stored in Stack - so if you pass a struct as argument to method - a new struct will be created on stack and values will be copied - this is a time consumingp process in the order of n.

Class is stored in Heap - so the same reference can be passed to various methods without duplication. (More...)

Which method will get executed first, if you have two methods in Javascript with same name and arguments?

  
The second method will get executed and the first method will not be referred. (More...)

Name the classes that derive from the abstract System.Windows.Shapes.Shape class in WPF?

  
1) Rectangle
2) Ellipse
3) Line
4) Polyline
5) Polygon
6) Path (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

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 Interview Question 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    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend