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
What is object and example?
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 use class?
What is pure oop?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What is abstraction and encapsulation?
What is encapsulation in simple terms?
Can you inherit a private class?
What are constructors in oop?
What does and I oop and sksksk mean?
What is difference between data abstraction and encapsulation?
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction
How many human genes are polymorphic?
How do you define a class in oop?
What is overriding vs overloading?