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 application of oops?

8 Answers   IBM,


what is the need of abstraction? what is abstraction?what is the abstraction for stack?

8 Answers   CTS, Verizon,


Why polymorphism is used in oops?

0 Answers  


How do you define a class in oop?

0 Answers  


What is the important feature of inheritance?

0 Answers   BPL,






When is a memory allocated to a class?

11 Answers  


Polymorphism with an example?

8 Answers   Accenture, emc2,


Write a c++ program to display pass and fail for three student using static member function

0 Answers  


what is the diffrence between c# and c++

5 Answers  


What is static in oop?

0 Answers  


When is an object created and what is its lifetime?

4 Answers   IBM,


Explain the concepts involved in Object Oriented programming.

0 Answers   Wipro,


Categories