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 costructor?

1 Answers  


Write an operator overloading program to Overload ‘>’ operator so as to find greater among two instances of the class.

1 Answers  


where is memory for struct allocated? where is memory for class-object allocated? I replied for struct in stack and for class-object in heap. THen he asked if class has struct member variable what happens.class on heap and what about struct in that class? couldnt ans :( :-?

2 Answers   Infosys, Microsoft,


what is diff between .net 1.1 and .net 2.0

4 Answers  


What is multilevel inheritance?

0 Answers  






What do you mean by Encapsulation?

0 Answers   Ittiam Systems,


Can you inherit a private class?

0 Answers  


Hi All, I am new to programming and want to know how can i write a code to take input of 2 numbers from user and swap it without using a temp variable?

2 Answers   NIIT,


Can abstract class have normal methods?

0 Answers  


What is Iteration Hierarchy? What is what is Object behavioral concept?

1 Answers  


hi all..i want to know oops concepts clearly can any1 explain??

0 Answers   Eureka Forbes,


What is multiple inheritance ?

17 Answers   Blue Star, C DAC, CDAC, Impetus, Ness Technologies, Softvision Solution,


Categories