M/F 2:30-3:20   
in G01 Gates Hall

CS 1130: Transition to OO Programming

Spring 2016

Self-Help Exercise

Evaluating new-Expresions: Solution

There are two variables, p and q, initially containing null.

ghj

After execution of these assignments:

p= new Animal();
q=
new Patient();
p=
new Animal();

the variables and created objects look like this:

          ghj