




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Professor: Padua-Perez; Class: OBJECT-ORIENTED PROG I; Subject: Computer Science; University: University of Maryland; Term: Unknown 1989;
Typology: Exams
1 / 8
This page cannot be seen from the preview
Don't miss anything!





Name: _____________________ Student ID: _________________ Section: ____________________ Problem 1 (20 points) General Questions.
Problem 3 (25 points) On the following page write a memory diagram representing the variables, and objects in the callstack and heap at the point where execution reaches the point marked as “STOP HERE”. Notice this point is before the method returns (that is, we also want to see the values of the local variables within “process” before it exits.) public class Prob3 { public void process(String[] data, int theIndex, String theInfo) { data[theIndex] = theInfo; theIndex = 1; // STOP HERE } public Prob3() { String[] strValues = new String[4]; strValues[1] = new String("House"); strValues[2] = new String("Permit"); String info = new String("Warning"); int index = 0; process(strValues, index, info); } public static void main(String[] args) { Prob3 prob3 = new Prob3(); } } Fill in the memory diagram template on the next page
Fill in memory diagram here Call Stack Heap
Extra page for code writing
Extra page for code writing