Can we call a base class method without creating instance?

Answers were Sorted based on User's Feedback



Can we call a base class method without creating instance?..

Answer / nk

Onlu static methods can be called without creating any
instance of the class.

Is This Answer Correct ?    23 Yes 1 No

Can we call a base class method without creating instance?..

Answer / amit sharma

U've to derieve the class first and then when u instanciate
the derieved class. Then :-

U can call it using derieved class object or in a derieved
class member function depending upon base class fun's acess
specifer and inheritence specifier.

Is This Answer Correct ?    11 Yes 1 No

Can we call a base class method without creating instance?..

Answer / sanjay makwana, puna

e.g. class X
{
int x;
X()
{
cout << "X";
}
public :
static void fun()
{
cout << "fun";
}
};

you may called like
X::fun();

Is This Answer Correct ?    10 Yes 3 No

Can we call a base class method without creating instance?..

Answer / rajesh

With :: operator

Is This Answer Correct ?    10 Yes 4 No

Can we call a base class method without creating instance?..

Answer / sg

Definitely,we have declare base class as static

Is This Answer Correct ?    3 Yes 2 No

Can we call a base class method without creating instance?..

Answer / vijaya

by declaring that method as static we have call it without creating instance of that class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

monkey starts climbing up a tree 20ft tall,each hour ,it hops 3ft and slips back by 2ft .how much time it wil tak to reach top of the tree?

13 Answers   IonIdea,


why constructor cannt be declar virtually? why destructor cannt be overloaded?

2 Answers   Infosys,


What is polymorphism in oop example?

0 Answers  


What is abstraction with example?

0 Answers  


what is single inheritance?

18 Answers   IBM,






what is the definition of incapsulation

2 Answers  


What is the difference between pass by reference and pass by value?

12 Answers   Pfizer, TCS,


Write on signed and unsigned integers and give three (3) examples each

1 Answers  


Write A Program using Single and Multiple Inheritance.

1 Answers  


What is a scope resolution operator?

5 Answers   HP, IBS,


How do you explain polymorphism?

0 Answers  


what is the difference between function template and template of function?explain with example.

2 Answers  


Categories