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 |
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
create a c++ program that will accepts 9 inputs using 3 by 3 array.
How is polymorphism achieved?
wht is ditch
The type of variable a pointer points to must be the part of pointer's definition so that:
Can anyone please explain runtime polymorphism with a real time example??at what ciscumstances we go for it??
What is static modifier?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
What are the data types in oop?
What is solid in oops?
The company is a fake company asking for money of RS10000 while training and not offering a job after training. My humble request to you people not to attend Astersys interview
what is cast operator?