Can we call a base class method without creating instance?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is cohesion in oop?

724


What is solid in oops?

706


can we make game by using c

3567


Which type does string inherit from?

713


What is encapsulation with example?

673






What is encapsulation in oops?

633


what are the ways in which a constructors can be called?

1676


What is the main feature of oop?

750


What is abstraction encapsulation?

749


write a program to find 2^n+1 ?

1654


How do you achieve runtime polymorphism?

648


What is new keyword in oops?

686


What is inheritance in simple words?

712


Is react oop?

708


Why do we use oops?

672