can we make a class static without using static keyword?
Answer Posted / mamta subramanian
We cannot declare any outer class as static. There would a
compiler error if we do so.
But if it is an inner class we can declare it as static.
and it act as a static object of outer class.
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
Why do we need oop?
What is multilevel inheritance in oop?
What is difference between abstraction and encapsulation?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
What is encapsulation c#?
Is oop better than procedural?
What are constructors in oop?
write a programe to calculate the simple intrest and compund intrest using by function overlading
How do you use inheritance in unity?
What is oops and why we use oops?
What is the point of oop?
what is the sylabus for priliminaries?
What is interface in oop?
What is difference between pop and oop?