Question

What are the member variables? Does this include a destructor? Why do you need a destructor...

What are the member variables?

Does this include a destructor? Why do you need a destructor in C++ but not in Java?

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

Member variables concept is in object-oriented programming. A member variable is a variable which is associated with a specific object and it can be accessible by all the methods in the object.

Destructor is used to delete the memory allotted to variables in C++.

But in Java, destructor is not required, since Java by default provides Garbage Collection which periodically frees the memory which is not being referenced for a specific period of time.

Add a comment
Know the answer?
Add Answer to:
What are the member variables? Does this include a destructor? Why do you need a destructor...
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