有一个接口的定义如下: public interface Motion { void walk(); void run(); } 下面代码是可以通过编译的( )。
A.
public class Man extends Motion { void walk() { System.out.print("The man is walking."); } void run() { System.out.print("The man is running."); } }
B.
public class Man implements Motion { void walk() { System.out.print("The man is walking."); } void run() { System.out.print("The man is running."); } }
C.
public abstract class Man implements Motion { void walk() { System.out.print("The man is walking."); } }
D.
public abstract class Man implements Motion { public void walk() { System.out.print("The man is walking."); } public void run() { System.out.print("The man is running."); } }