Click here to Skip to main content
15,888,600 members
Please Sign up or sign in to vote.
1.80/5 (3 votes)
See more:
hi... i want to know that what are the reasons to use classes.. i don't need example just need explanation of this why we use classes and where we use classe... hope u understand my point????
Posted

1 solution

No. Your point is hard to understand. For C#, this is the same as to ask "why do we have to breath? where we breath?".

C# is purely object-oriented language, it is designed the way that you virtually cannot write anything without classes. To write a single method, you already need it to be a method in a class or a structure.

If you need to understand why people invented classes, why those classes have been introduced in computer science and computing practice, what are the benefits or downsides of OOP, giving you one or few Quick Answers would be totally useless. You need to read some literature on OOP, to get some basic ideas. Well, programming by extension, encapsulation, abstraction, late binding, polymorphism, open-close principle, all those things. However, reading one good book with understanding, reinforced be some practice, would be enough to catch up.

—SA
 
Share this answer
 
Comments
Meysam Toluie 3-Sep-13 3:10am    
I like the way you answer these type of question.
Thank you.
Sergey Alexandrovich Kryukov 3-Sep-13 12:03pm    
Thank you, Meysam.
If you want to reply to such kind of "questions", it's not easy to decide what to write about.
Look at the OP's comment below. And what to answer to such a person? :-)
—SA
Sergey Alexandrovich Kryukov 3-Sep-13 12:02pm    
Please stop it. I answered clearly. Your question is simply incorrect.
—SA
Joezer BH 3-Sep-13 4:31am    
5ed!
Sergey Alexandrovich Kryukov 3-Sep-13 12:03pm    
Thank you very much.
—SA

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