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
Can we have a non static member function in a base class to 
be override in derived with static modifier?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Can we have a non static member function in a base class to be override in derived with static modifier?
Answer
# 1
No.
A Static member can not be declared override, virtual, 
abstract.
 
Is This Answer Correct ?    3 Yes 0 No
Guest
 
  Re: Can we have a non static member function in a base class to be override in derived with static modifier?
Answer
# 2
No, we cannot derive static class from a user defined 
class. They can only be derived from object class.
 
Is This Answer Correct ?    1 Yes 0 No
Parmjit
 
 
 
  Re: Can we have a non static member function in a base class to be override in derived with static modifier?
Answer
# 3
yes we can have a nonstatic membe function in the base , 
which can be override in derived class with static modiier.

for ex:
class sample
{
        public:
        static void get(){cout<<"this is base class 
function:"<<endl;}
        static void put(){cout<<"this is a put function of 
base class :"<<endl;}
};
class sample1:public sample
{
        public:
        void put(){cout<<"this is a derived class 
function:"<<endl;}
};
sample class is havinfg a non static member function put 
which is overidden in dervied which static key word.

Which runs fine.
 
Is This Answer Correct ?    0 Yes 0 No
Srinivas
 
  Re: Can we have a non static member function in a base class to be override in derived with static modifier?
Answer
# 4
sorry i have given the reverse once . Even the reverse 
works fine..

class sample
{
        public:
        static void get(){cout<<"this is base class 
function:"<<endl;}
        void put(){cout<<"this is a put function of base 
class :"<<endl;}
};
class sample1:public sample
{
        public:
        static void put(){cout<<"this is a derived class 
function:"<<endl;}
};
 
Is This Answer Correct ?    0 Yes 0 No
Srinivas
 
  Re: Can we have a non static member function in a base class to be override in derived with static modifier?
Answer
# 5
No We cant ovver ride static member function in a base 
class.
 
Is This Answer Correct ?    0 Yes 0 No
Sanjay
 

 
 
 
Other C Sharp Interview Questions
 
  Question Asked @ Answers
 
What is the raise event used for? Wipro1
What statements can enclose a "continue" statement?  3
Y go for Interface? What is use of interface?  3
What?s the difference between the System.Array.CopyTo() and System.Array.Clone()?  3
Explain the difference between a sub and a function? Wipro1
How?s method overriding different from overloading? Visual-Soft2
What are the two kinds of properties? Wipro10
Difference between multi-level and multiple inheritance? Microsoft6
Can you prevent your class from being inherited and becoming a base class for some other classes?  2
What?s an abstract class? NIIT2
What happens in synchronisation? Tech-Mahindra2
How can we give strong name to assembly? What is satellite assembly? SMNetserv2
How you will connect to windows directory in c#? HP2
Any exceptions are there which are not caught by any catch blocks? what are they? Honeywell5
Why is it a bad idea to throw your own exceptions? Visual-Soft1
What?s a multicast delegate?  1
Can property defined in Interface. Synechron1
A->B->C (EXTENDS) How the constructors are called when we created an object of C Karur-Vysya-Bank-KVB2
What?s the difference between System.String and System.StringBuilder classes?  4
from web.config file with connection string who to interact means who to connect in gridview. in my system shows null something error what is the problem Bally-Technologies2
 
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