ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Microsoft Related >> C Sharp
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions (615)
 C Sharp interview questions  C Sharp Interview Questions (722)
 ASP.NET interview questions  ASP.NET Interview Questions (1444)
 VB.NET interview questions  VB.NET Interview Questions (151)
 COM+ interview questions  COM+ Interview Questions (41)
 ADO.NET interview questions  ADO.NET Interview Questions (199)
 IIS interview questions  IIS Interview Questions (86)
 MTS interview questions  MTS Interview Questions (5)
 Crystal Reports interview questions  Crystal Reports Interview Questions (62)
 BizTalk interview questions  BizTalk Interview Questions (33)
 Dot Net interview questions  Dot Net Interview Questions (861)
 Exchange Server interview questions  Exchange Server Interview Questions (103)
 SharePoint interview questions  SharePoint Interview Questions (25)
 WCF interview questions  WCF Interview Questions (8)
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions (193)
Question
How do you create multiple inheritance in C#?
 Question Submitted By :: C-Sharp
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
C# does'nt support multiple inheritance. In that situation
we use interface
 
Is This Answer Correct ?    106 Yes 8 No
Shafi Syed
 
Answer
# 2
if u want to crate multile inheritance in C#

u can use intface
 
Is This Answer Correct ?    98 Yes 10 No
Jiten
 
 
 
Answer
# 3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestApp
{
class MultipleInheritance : first, Isecond
{
Isecond objsecond = new second();

#region Isecond Members

public void secondfunction()
{
objsecond.secondfunction();
}

#endregion
}
class first
{
public first()
{
}

public void firstfunction()
{
Console.WriteLine("First funciton called");
}
}
interface Isecond
{
void secondfunction();
}
class second : Isecond
{
public second()
{
}

public void secondfunction()
{
Console.WriteLine("Second function called");
}
}

class Program
{
static void Main(string[] args)
{
//multiple inheritance
MultipleInheritance obj = new MultipleInheritance();
obj.firstfunction();
obj.secondfunction();

Console.ReadLine();
}
}
}
 
Is This Answer Correct ?    47 Yes 19 No
Neeraj Tyagi
 
Answer
# 4
C# doesn't support Multiple Inheritance,,,SO to over come this problem Interface came into picture.Interface is not a class,but it is a parent to base class.

Interface Forest
{
void Greet();
}

class Animal: Forest
{
public void Greet()
{
Console.WriteLine("Animal says Hello");
}

public void Sing()
{
Console.WriteLine("Animal Sings");
}
}

class Program : Animal,Forest
{
static void Main(string[] args)
{
Program obj = New Program();
obj.Greet();
obj.Sing();
Console.ReadLine();
}
}
 
Is This Answer Correct ?    5 Yes 3 No
Pavankumar
 
Answer
# 5
using System;

interface Interdemo
{
void Show();
}

class Interimp:Interdemo
{
public void Show()
{
Console.WriteLine("Show() method Implemented");
}

public static void Main(string[] args)
{
Interimp inter = new Interimp();
inter.Show();
}
}
 
Is This Answer Correct ?    36 Yes 36 No
Frank
 

 
 
 
Other C Sharp Interview Questions
 
  Question Asked @ Answers
 
An abstract class is inherited, an Interface also inherited(multiple inheritance), How it differences. Synechron 6
When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)? Mind-Tree 2
wipro interview question on 28-Apr-10 1.what type of authentication used in web service, 2.what are type of multithreding ? 3.diff bet delegate and multithreading? 4.how to write update query trigger in stored procedure. 5. if you are so sharp then what happens when you click .net appln exe in system,who CLR get loaded. 6.how to use work flown in application. 7.what is main purpose of script manager. 8.how u handle cretical transaction. 9.how you syncronize the method from no of user, 10.how change name of shared assambly   1
What namespaces are necessary to create a localized application? Visual-Soft 2
What are the valid parameter types we can pass in an Indexer ? CMC 3
What?s the implicit name of the parameter that gets passed into the class? set method?   1
How did you implemented classes in your project? TCS 1
What is a pre-requisite for connection pooling?   2
Will finally block get executed if the exception had not occurred?   2
How can you overload a method?   6
how to retrieve binary data from database (using c#.net and sql server/windows application) Soltius 2
How structure objects are destroyed? As GC releases only the objects in stack, and structure is a value type and stored in heap. So how structure objects are released?   2
 
For more C Sharp Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com