Please tell me deeply about classes and objects
My Question are:
What is class?
Why we use class?
How can we use class?
what do help class?
Please tell me and also tell how can I learn about class?

Recommended Answers

All 2 Replies

Reading a tutorial on the net will probably help you more than any explanation you could get here but briefly: in object oriented programming a class allows you separate code into units (classes) for ease of reuse and to keep relevant code functions together.
Say you created a class called Dog. You could then put dog related methods into this class such bark() or dragButtOnFloor(). Then in your calling code you first create an instance of the Dog class and then call it's methods. In c#

Dog dog = new Dog();
dog.bark();

Classes also allow for things like inheritance which is another topic you will want to learn about too.
But, as I said, an online resource or book will provide the depth you need to learn these concepts.

http://en.wikipedia.org/wiki/Object-oriented_programming

What you've asked can be simple or complex based on what programming you've already done.

For me, the real magic of classes doesn't happen until I get to the SECOND object in a collection and I realize how much code I didn't have to write (or test) to use it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.