Given the following definitions of the interfaces Movable and Jumpable, the task is to declare a class Person that inherits both of these interfaces. Which of the following code snippets will accomplish this task? (Select 2 options.)
Given the following definitions of the interfaces Movable and Jumpable, the task is to declare a class Person that inherits both of these interfaces. Which of the following code snippets will accomplish this task? (Select 2 options.)
interface Movable {}
interface Jumpable {}
a) interface Movable {}
interface Jumpable {}
class Person implements Movable, Jumpable {}
b) interface Movable {}
interface Jumpable {}
class Person extends Movable, Jumpable {}
c) interface Movable {}
interface Jumpable {}
class Person implements Movable extends Jumpable {}
d) interface Movable {}
interface Jumpable implements Movable {}
class Person implements Jumpable {}
e) interface Movable {}
interface Jumpable extends Movable {}
class Person implements Jumpable {}
Answer:
An interface can't execute one more interface in Java. An interface in Java is basically an extraordinary sort of class. Like classes, the interface contains techniques and variables. Not at all like classes, interfaces are in every case totally dynamic.
Step by step
Solved in 2 steps