Consider the following partial declarations. public class Direction public class
ID: 3643439 • Letter: C
Question
Consider the following partial declarations.public class Direction public class Car
{ {
private int degrees; private Direction dir;
public Direction(int deg) private Location loc;
{ public Car(Direction d , Location l)
degrees = deg; {
System.out.println("direction "); dir = d;
} loc = l;
... System.out.println("car");
} }
...
public class Location }
{
private double xLoc, yLoc; public class RaceCar extends Car
public Location(double x, double y) {
{ private double speed;
xLoc = x; public RaceCar(Direction d, Location l,
yLoc = y; double sp)
System.out.println("location "); {
} super(d, l);
... speed = sp;
} System.out.println("race-car");
}
...
}
Consider the statement
RaceCar TSX = new RaceCar(new Direction(90), new Location(5, 8), 160);
What is printed when this statement is executed?
*ANSWER CHOICES*
A.) location direction race-car car
B.) direction location race-car car
C.) direction location car race-car
D.) race-car car direction location
E.) car race-car direction location
Explanation / Answer
C.) direction location car race-car this is because the command for the print of Direction is given first