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 |
Write a program to multiply 3x3 matrics
Write a program to reverse a string using recursive function?
What is the difference between a mixin and inheritance?
what are the different types of qualifier in java?
What is abstraction and encapsulation?
Name an advantage of linked list over array?
Contrast OOP and SOA. What are tenets of each?
1 Answers Siebel Systems, Wipro,
What do you mean by variable?
what is the use of mutable key word
What is destructor give example?
What is the concept of object oriented program?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)