ALLInterview.com :: Home Page KalAajKal.com
 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                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  C Sharp
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
About Virtual functions and their use ?
 Question Submitted By :: Deepa
I also faced this Question!!     Rank Answer Posted By  
 
  Re: About Virtual functions and their use ?
Answer
# 1
virtual function is used to overddin that function in 
derived class
 
Is This Answer Correct ?    7 Yes 1 No
Sam
 
  Re: About Virtual functions and their use ?
Answer
# 2
The Virtual is a keyword it used in the base class.When we
use the Virtual keyword in the function it must be override
in the  inherited class with the same name.
 
Is This Answer Correct ?    4 Yes 4 No
Tiger Skumar
 
 
 
  Re: About Virtual functions and their use ?
Answer
# 3
If the instance function declared with a virtual modifier 
then the function is called virtual function.

the derived class can give the redefinition to the virtual 
function its optional.
 
Is This Answer Correct ?    4 Yes 0 No
Anand
 
  Re: About Virtual functions and their use ?
Answer
# 4
Second answer given here is correct to some extent.
If we use Virtual keywork next to a mehtod,it can be 
overridden in derived classes,but it is not must to 
override.
 
Is This Answer Correct ?    5 Yes 1 No
Deepika
 
  Re: About Virtual functions and their use ?
Answer
# 5
Virtual Method are feature of object oriented programming
and used to Identify the Type of object that is calling any
particular method at the Run time so provides flexibility in
calling method.
 
Is This Answer Correct ?    2 Yes 0 No
Vishal Sharma
 
  Re: About Virtual functions and their use ?
Answer
# 6
when we override a metod in sub class,and we want to hide 
the decelaration of the base class member then we used the 
keyword virtual in superclass,
and keyword override in the subclass
 
Is This Answer Correct ?    2 Yes 0 No
Vijay Rana
 
  Re: About Virtual functions and their use ?
Answer
# 7
intersection of 4 & 6
 
Is This Answer Correct ?    2 Yes 0 No
Jyothish Vakkom
 
  Re: About Virtual functions and their use ?
Answer
# 8
If a base class method is to be overriden, It is defined 
using virtual keyword. You need to use the override keyword 
in order to re-implement the virtual method. Exp:

public class Employee
{
public virtual void SetBasic(float money) //This method may 
be overriden
{ Basic += money; }
}


public class Manager : Employee
{
public override void SetBasic(float money) //This method is 
being overriden
{
float managerIncentive = 10000;
base.SetSalary(money + managerIncentive); //Calling base 
class method
}
}
 
Is This Answer Correct ?    0 Yes 0 No
Deepak Jindal
 

 
 
 
Other C Sharp Interview Questions
 
  Question Asked @ Answers
 
Can we create instance for Abstract class? HCL13
what is diffrence between protected ,internal and protected internal?? whether protected field available in derived class which is outside the assembly. if not ..this is possible by which access modifiers??  1
What is a delegate?  4
What does assemblyinfo.cs consists ? Microsoft2
Can we inherit a private class in chsarp? how? explain(with code) ? Techno-Labs3
Is there any way to access private memebers of an object from another object? TCS4
Why is it a bad idea to throw your own exceptions? Visual-Soft1
How do you implement Inheritance in dot net ? MMTS3
What are the Different kinds of methods? Wipro4
How many catch blocks can be there for a single try block? HCL2
Can you inherit multiple interfaces?  3
what is satelite assembly? ABC3
How?s the DLL Hell problem solved in .NET?  2
Use of Checked and UnChecked operators? TCS1
how to store the value in textbox using delegates if we have two user control. the value will be called from one user control to another user control. Loading and unloading will be done through delegates.  1
Difference between multi-level and multiple inheritance? Microsoft3
what is an internal specifier? what happens internally when I use access specifier Internal ? rsystems4
How?s the DLL Hell problem solved in .NET? Visual-Soft1
Can you allow class to be inherited, but prevent the method from being over-ridden? Mind-Tree2
What?s the implicit name of the parameter that gets passed into the class? set method?  1
 
For more C Sharp Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com