1. What is the output of the following Java program? Explain in terms of how parameters are passed in Java. See image.
Suppose a similar program were written in C# in which all the parameters were ref parameters. What would the output of that program be?
2. Consider the following Java definition of an integer list class. See image.
Suppose this class was rewritten in C++ in two ways, the first with the array that represents the list as a stack-dynamic variable, and then with the list as a heap dynamic variable. Explain when constructors and destructors would be needed. Explain why no constructors or destructors are needed in the Java implementation.