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                      
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
 WCF interview questions  WCF Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
Can you override private virtual methods?
 Question Submitted By :: Umesh
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Can you override private virtual methods?
Answer
# 1
No, moreover, you cannot access private methods in
inherited classes, have to be protected in the base class to
allow any sort of access.
 
Is This Answer Correct ?    27 Yes 6 No
Umesh
 
  Re: Can you override private virtual methods?
Answer
# 2
first let me know wht is the benfit specifying virtual
method as private.
 
Is This Answer Correct ?    4 Yes 11 No
Prashanth
 
 
 
  Re: Can you override private virtual methods?
Answer
# 3
we should not use Private Access Specefier for
VIRTUAL ,ABSTRACT ,INTERFACES
 
Is This Answer Correct ?    14 Yes 4 No
Suresh.gv
 
  Re: Can you override private virtual methods?
Answer
# 4
no 
Is This Answer Correct ?    10 Yes 4 No
Pk
 
  Re: Can you override private virtual methods?
Answer
# 5
yes 
Is This Answer Correct ?    12 Yes 16 No
Bk Sahoo
 
  Re: Can you override private virtual methods?
Answer
# 6
WE can not use private access modifier for VIRTUAL,INTERFACE
and also we can not inherit private methods or properties
in inherited classes.
 
Is This Answer Correct ?    14 Yes 2 No
Payal Mehta
 
  Re: Can you override private virtual methods?
Answer
# 7
No

virtual or abstract members cannot be private
 
Is This Answer Correct ?    11 Yes 3 No
Kiran
 
  Re: Can you override private virtual methods?
Answer
# 8
we cant use private access modifier for VIRTUAL, INTERFACE
and ABSTRACT
 
Is This Answer Correct ?    7 Yes 2 No
Asim Bukhari
 
  Re: Can you override private virtual methods?
Answer
# 9
No. 
Is This Answer Correct ?    1 Yes 0 No
Faisal
 
  Re: Can you override private virtual methods?
Answer
# 10
virtual or abstract members cannot be private.

Ex: error occurs during the static compilation phase, which
means that no program that declares a private virtual method
will ever be executed in any way.
C#
class A
{
private virtual int Test()
{
return 1;
}
}

class Program
{
static void Main()
{
}
}

Compile-time error

Error 1
'A.Test()': virtual or abstract members cannot be private
 
Is This Answer Correct ?    0 Yes 0 No
Vivek
 

 
 
 
Other C Sharp Interview Questions
 
  Question Asked @ Answers
 
may we achieve polyphormsm through overloading a funtion?Is it right or wrong concept because i read polyphormism can be achieved through overloading?plz help me thnks  1
If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor?  2
What is overloading and how can this be done ? MMTS4
Why multiple inheritance is not possible in c#  6
How do you secure a webservice? TCS1
can it possible to acees the virthual method using the override method object? plz give me the example  2
Describe the accessibility modifier protected internal. Visual-Soft2
can u tell me any one steps for creatting sn.k  2
About a class access specifiers and method access specifiers ? MMTS3
can we throw execption from catchblock Accenture4
what is output parameter and parameter array? TCS1
What is the Difference between a sub and a function? Wipro3
 
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 © 2012  ALLInterview.com.  All Rights Reserved.

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