Question

can someone explain to me classes, deconstructors, and constructor in a way a 5 year old...

can someone explain to me classes, deconstructors, and constructor in a way a 5 year old would understand haha.....

0 0
Add a comment Improve this question Transcribed image text
Answer #1

classes: A class can be defined as a skeleton for an object or blueprint for an object or template for an object. A class defines the variables and methods, an object should have. An object is an instance of a class. They help in organizing our programs,

. As they allow the programmers to achieve bottom-up approach, in addition to the top-down approach.

. As the use of inheritance will help the classes to be organized as a hierarchy.

. As they bring together both the data and methods are needed.

Constructor: A special type of method that has the same name as that its class and by convention STARTS WITH CAPITAL Letter. Whenever an object of a class is created, its constructor will be invoked and it will initialize the object. The return type for a constructor is not defined as it implicitly takes its class type as its return type. Constructors are unable to inherited.No-args constructor is supplied by default. It cannot be abstract, final, native static or synchronized.Constructors are of 5 kinds i.e Default Constructor(without parameters), Parametrized Constructor(contains parameters), Copy Constructor, Static Constructor, and Private Constructor.

Destructor: A type of method that has the same name containing the (~) tiled operator. Employed for smashing the object of a class.Unable to possess the arguments.

Add a comment
Know the answer?
Add Answer to:
can someone explain to me classes, deconstructors, and constructor in a way a 5 year old...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT