📄 question4.java
字号:
interface Vehicle
{
public void start(int i);
public void stop(int j);
}
class Bike implements Vehicle
{
public void start(int i)
{
System.out.println("Bike started as "+i+"\n");
}
public void stop(int i)
{
System.out.println("Bike stopped as "+i+"\n");
}
}
class Bus implements Vehicle
{
public void start(int i)
{
System.out.println("Bus started as "+i+"\n");
}
public void stop(int i)
{
System.out.println("Bus stopped as "+i+"\n");
}
}
class interfaceDemo
{
public static void main(String args[])
{
Bike bike=new Bike();
bike.start(10);
bike.stop(1);
Bus bus=new Bus();
bus.start(20);
bus.stop(1);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -