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 a Polymorphism? How many types of polymorphism and whats that use in application?

2 Answers  


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

0 Answers   CAT,


What is overloading and its types?

0 Answers  


sir plz send me a set of questions that been frequently held in written examination during campus selection.

0 Answers   TCS,


Why static functions always uses static variables?

3 Answers  






What type of loop is a for loop?

0 Answers  


Have you ever used threads?

3 Answers   Adobe, IBM,


what is a class

6 Answers  


can you give real time example for polymarphism

5 Answers   TCS,


can you explain how to use JavaBean in Project

3 Answers   Infosys, Satyam,


What is persistence in oop?

0 Answers  


What is overloading in oops?

0 Answers  


Categories