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 |
Please tell me the oops concept with detailed answer
Why is oop useful?
what is difference between String s=new String("vali"); String s="vali"
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
Describe the difference between a Thread and a Process?
Which keyword is written to use a variable declared in one class in the other class?
what is multithreading in c++ , what is difference between multithreading and singlethreading.
what is runtime polymorphism? For the 5 marks.
What is a macro? And how is a macro same as a template?
You attempt to query the data base with this command: SELECT name, salary FROM employee WHERE salary=(SELECT salary FROM employee WHERE last name='Wagner' OR dept no=233) Choose most appropriate option from the following: 1)Sub-queries are not allowed in the where clause. 2)a multiple row sub-query used with a single row comparison operator. 3)a single row query is used with a multiple row comparison operator.
How to improve object oriented design skills?
Why many objects can working together? How objects working togetherM I want to see example code.