Also show the result which gets printed in each case

Info icon This preview shows pages 3–4. Sign up to view the full content.

value-result, and (d) call by name? Also, show the result which gets printed in each case. The following table shows the results for each calling method. Call by A[0] i A[0] o A[1] i A[1] o A[2] i A[2] o I i I o X i X o Y i Y o Res value 7 7 11 11 13 13 0 2 7 7 0 1 8 reference 7 7 11 11 13 13 0 1 a1 a1 a2 a2 8 value-result 7 7 11 11 13 13 0 1 7 7 0 1 8 name 7 7 11 11 13 13 0 1 t1 t1 t2 t2 12 a1 - addr ( A [0] ) a2 - addr ( I ) t1 - thunk ( A [I] ) t2 - thunk ( I ) Assuming all parameters are passed by reference, does aliasing occur in this program? If so, where? Aliasing does occur in F as I may be referred to by its own name or by formal parameter Y.
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

8. Consider the following Java code snippet: try { System . out . println (1); try { System . out . println (2); f (); System . out . println (3); } catch (E1 e1) { System . out. println (4); } finally { System . out. println (5); } } catch (E2 e2) { System . out . println (6); } Indicate the output of this snippet for the cases where (a) there is no exception, (b) f throws exception E1 , (c) f throws exception E2 , and (d) f throws exception E3 . (a) 1, 2, 3, 5 (b) 1, 2, 4, 5 (c) 1, 2, 5, 6 (d) 1, 2, 5, Exception
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '09
  • css, activation record, virtual method table

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern