Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all i m just removing this question if its teaching cheat to students or misleading some others.

Which of the following is/are true about the class?

(A) Classes can have both constructors and destructors
(B) Classes are reference type
(C) Classes does not support Inheritance
(D) All of the above are true




Thanks.
Posted
Updated 24-Jul-13 20:50pm
v4
Comments
Pheonyx 24-Jul-13 9:02am    
Do you mean Constructors not Contractors ?
S.P.Tiwari 24-Jul-13 9:09am    
yes constructors.
i just copy ans paste the same from the site where i found.
Thanks
Sergey Alexandrovich Kryukov 24-Jul-13 9:59am    
With such knowledge of you and "debaters", there is nothing to do in development. And there is nothing more destructive to knowledge than those multiple-choice question. You are not learning anything, just fooling around.
—SA

1 solution

The answer is A and B...

Classes can have constructors and destructors. (If you can construct it, you need to be able to destroy it)
Classes are reference types (value types are like int, long, short, etc)
Classes DO support inheritance, its a fundamental concept of OOP.

I'm not sure what the debate can be. C++ and C# both support inheritance on classes. The only debate I can think of is multiple inheritance which C# does not support and C++ does.
 
Share this answer
 
Comments
S.P.Tiwari 24-Jul-13 9:16am    
thanks.
Sergey Alexandrovich Kryukov 24-Jul-13 10:02am    
All correct, but sorry, I just cannot lift my hand to vote. To me, existing of such questions, and such questionnaires, and people playing such stupid games is such a shame. If it just the anti-knowledge in the very beginning. I hope you understand me...
—SA
Ron Beyer 24-Jul-13 10:16am    
Understood, the methodology is flawed I agree, I also believe that multiple choice questions don't further knowledge because they really don't require you to use your analytical or critical thinking skills.
Sergey Alexandrovich Kryukov 24-Jul-13 10:51am    
Worse, such questionnaires actually teach students to cheat.
—SA
Stefan_Lang 25-Jul-13 7:48am    
Actually, if taken literally, whether or not a class must be a reference type depends on the language you're talking about. In C/C++, classes can be used both by value and by reference.

The Wikipedia article at http://en.wikipedia.org/wiki/Reference_type even states that in managed C++/CLI you can explicitely define a value type class or struct with the value keyword!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900