Can we call a base class method without creating instance?
Answers were Sorted based on User's Feedback
Answer / nk
Onlu static methods can be called without creating any
instance of the class.
| Is This Answer Correct ? | 23 Yes | 1 No |
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 |
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 |
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 |
What does the code "cout<<(0==0);" print? 1) 0 2) 1 3) Compiler error: Lvalue required
How would you stop a class from class from being derived or inherited.
What is the correct syntax for inheritance? 1) class aclass : public superclass 2) class aclass inherit superclass 3) class aclass <-superclass
What is namespace?
The type of variable a pointer points to must be the part of pointer's definition so that:
why we are declare the function in the abstract class even though we are declaring it in Derived class?
• What are the desirable attributes for memory managment?
Tell me the scenario,Where we can use interfaces or Abstract class.And What is the difference between interfaces and abstract class?
What is protected in oop?
Definition of Object Oriented Programming in single line?
33 Answers Impact Systems, Q3 Technologies, TCS,
Why oops is important?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.