CS 4120 PS5

2 i 0 f fa 3 cc1 4 dfc 5 6

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: one run of your analysis leads to the removal of the following grayed-out undead code: 1 a = 1 . 2 i ( ( ) > 0 { . f fa ) 3 . c=c1 + 4 . d=fc () 5 } . 6 [ ] = a c .d + + 7 g = a d . 3. Object layout Consider the following class declarations in a Java-like language with subtyping, inheritance, and method overloading, but with a simple type hierarchy in which no class has two parents: casA{ ls www.c s.c or ne ll.e du/c our se s/CS4120/2011f a /hw/ps5/ps5.html 2/4 2/7/13 CS 4120 PS5 ita n ; itf){cd 1} n ( oe } casBetnsA{ ls xed itb n ; itf){cd 2} n ( oe itgitx {cd 3} n (n ) oe ith){cd 4} n ( oe } casCetnsA{ ls xed itc n ; vi ffotx {cd 5} od (la ) oe itj){cd 6} n ( oe itg){cd 7} n ( oe } Assuming the simple dispatch table scheme with sequentially assigned method indices, draw the memory layout of three objects of classes A, B, and C respectively,...
View Full Document

This note was uploaded on 02/07/2013 for the course CS 4120 taught by Professor Andrewmyers during the Fall '09 term at Cornell.

Ask a homework question - tutors are online