JAVA的问题g
来源:百度知道 编辑:UC知道 时间:2024/07/08 09:28:02
interface TransportMethod {
void start() ;
void _break() ;
}
class Car implements TransportMethod {
public void start() {
System.out.println ("the car is starting") ;
}
public void _break() {
System.out.println ("the car is breaking") ;
}
}
public class InterfaceTester {
public static void main(String args[]) {
TransportMethod tm = new Car() ;
tm.start() ;
tm._break() ;
}
}
public interface Transportmethod{
public void start();
public void break();
}
public class Car implements Transportmethod {
public void start() {
System.out.println("the car is starting");
}
public void break () {
System.out.println("the car is breaking");
}
public static void main(String[] args)