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       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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
Trace the O/p for a program on inheritance and 
Polymorphism. 3 classes A,B,C 
A with two methods 
public virtual SomeMethodA 
public virtual SomemoreMethodA 

B:A 
overide SomeMethodA 

C:B new Method SomeMethodA 
override SomeMoreMethodA 

main method 
{ 
b new instance of B 
b.SomeMethodA 
b.SomeMoreMethodA 

b1 new instance of C 
b1.SomeMethodA 
b1.SomeMoreMethodA 

}
 Question Submitted By :: Mathew298
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Trace the O/p for a program on inheritance and Polymorphism. 3 classes A,B,C A with two methods public virtual SomeMethodA public virtual SomemoreMethodA B:A overide SomeMethodA C:B new Method SomeMethodA override SomeMoreMethodA main method { b new instance of B b.SomeMethodA b.SomeMoreMethodA b1 new instance of C b1.SomeMethodA b1.SomeMoreMethodA }
Answer
# 1
Call to B's SomeMethodA
Call to A's SomeMoreMethodA
Call to B's SomeMethodA
Call to C's SomeMoreMethodA
 
Is This Answer Correct ?    4 Yes 2 No
Vibz
 
  Re: Trace the O/p for a program on inheritance and Polymorphism. 3 classes A,B,C A with two methods public virtual SomeMethodA public virtual SomemoreMethodA B:A overide SomeMethodA C:B new Method SomeMethodA override SomeMoreMethodA main method { b new instance of B b.SomeMethodA b.SomeMoreMethodA b1 new instance of C b1.SomeMethodA b1.SomeMoreMethodA }
Answer
# 2
Vibz answer is correct at some level. but i am thinking
different way. 

Call to class B's SomeMethodA
Call to class A's SomeMoreMethodA
Call to class C's SomeMethodA  <-- our answers differ here
Call to class C's SomeMoreMethodA
 
Is This Answer Correct ?    1 Yes 1 No
Kanan
 
 
 

 
 
 
Other C Sharp Interview Questions
 
  Question Asked @ Answers
 
Can you store multiple data types in System.Array?  4
Can you store multiple data types in System.Array? Satyam9
How can you clean up objects holding resources from within the code? Wipro4
If a class is having 4 variables namely type double,type integer,type string,type decimal. If we create an instance of that class those variables which gets into this instance are value types or reference types? Kanbay3
I am using a data table and a datagridview. I am creating two columns in data grid view : 1)DataGridViewComboBoxColumn 2)DataGridViewTextBoxColumn. The items of datagridviewcombo are the list of all items in data table column 1. I want that the data type of the DataGridViewTextBoxColumn should be the same as the data type of the item selected from the datagridviewcombo at runtime. How can I do that.Also I want that each cell in column of datatable should be of variable data type. Pls help. thnx. Storm1
Can you change the value of a variable while debugging a C# application?  1
How can you sort the elements of the array in descending order?  3
What?s the implicit name of the parameter that gets passed into the class? set method? Visual-Soft2
what is an internal specifier? what happens internally when I use access specifier Internal ? rsystems4
What does the keyword virtual mean in the method definition? Visual-Soft2
Explain manifest & metadata? Wipro5
What?s the difference between System.String and System.StringBuilder classes?  4
How to make a class non-inheritable other than sealed?  3
What?s the .NET datatype that allows the retrieval of data by a unique key?  2
Can you prevent your class from being inherited and becoming a base class for some other classes?  4
what is read only and constant IBM8
explain synchronous and asynchronous in C# Synechron1
Will finally block get executed if the exception had not occurred?  2
How To Maintain Transaction In C#? Phoenix-Technologies1
What is ENUM? Wipro5
 
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