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

what is the drawback of classical methods in oops?

0 Answers  


What is OOPS and How it is different from Procedural Programming ?

23 Answers   HP, Infosys, Thyrocare,


Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

0 Answers   CAT,


I hv a same function name,arguments in both base class and dervied class, but the return type is different. Can we call this as a function overloading? Explain?

3 Answers  


Write 7 differences between "Public" function and "Private" function?

2 Answers   IBM, Wipro,


What is abstract class in oop?

0 Answers  


How do you define social class?

0 Answers  


Can anyone please explain runtime polymorphism with a real time example??at what ciscumstances we go for it??

1 Answers  


Why do we need oop?

0 Answers  


What is basic concept of oop?

0 Answers  


difference between static and non-static variables?

2 Answers  


what is the application of oops?

8 Answers   IBM,


Categories