Code Tracing: Assignment Statement
Given the following code
(It may be useful to refer to this information about the Human class.)
double x, y, z;
Human persona, role, part;
x = 3.1;
y = 4.2;
z = x;
persona = new Human("Leela");
role = new Human("Frye");
part = persona;
x = 8.2;
y = x;
persona.setName("Hermes");
persona = new Human("Amy");
role = persona;
persona.haveBirthday();
System.out.println(x);
System.out.println(y);
System.out.println(z);
System.out.println(persona.getName());
System.out.println(role.getAge());
System.out.println(part.getName());
What is printed out?
|
Console window: |
|
|
|
|