Problem:
Question 1: Explain how objects are created in Java and how the memory used by objects is recovered. Compare this to object creation and destruction in C++.
Question 2: Explain how primitive values like doubles are passed between functions in Java. How are string objects passed between functions in Java?
Question 3: How are static methods different from non-static methods? How do you invoke a static method? Give an example of a static method.
Please provide description of your answers.