Given the following partial class definitions:
public class Turtle {
...
public void turnLeft() { ... }
public void turnRight() { ... }
}

public class ConfusedTurtle extends Turtle {
...
public void turnLeft() { // missing code 1 }
public void turnRight() { // missing code 2 }
...
}
Which of the following can replace the missing code so that when a ConfusedTurtle is asked to turn left via the method turnLeft it will actually turn right and when a ConfusedTurtle is asked to turn right via the method turnRight it will actually turn left?
a. turnRight(); // missing code 1
turnLeft(); // missing code 2
b. this.turnRight(); // missing code 1
this.turnLeft(); // missing code 2
c. turnLeft(); // missing code 1
turnRight(); // missing code 2
d. this.turnLeft(); // missing code 1
this.turnRight(); // missing code 2



Answer :

Other Questions