Question

1. Explain the differences between a class and an object. 2. Explain what it means to...

1. Explain the differences between a class and an object.

2. Explain what it means to instantiate an object.

3 .Explain the advantages of using objects over arrays and collections in terms of encapsulation

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

1) Difference between a class and an object are :-

Class is a template or idea from which objects are created. It has all the functions and variable with labels which are used by the object. And, whereas we know object is an instance of a class. One can say class is a logical entity whereas object is a physical entity

2) Instantiate an object means construction of an object which a group of properties defined by the class and it's constructor and functions. Initialize with the given and default values. Simple words to create a instance of an object

3)Main advantage of object over arrays and collections in terms of encapsulation is that through object one can encapsulate different items at once ; not necessarily same type of items.

Add a comment
Know the answer?
Add Answer to:
1. Explain the differences between a class and an object. 2. Explain what it means to...
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