📄 demo.java
字号:
interface PCI
{
void start();
void stop();
}
class DisplayCard implements PCI
{
public void start()
{
System.out.println("Display...");
}
public void stop()
{
System.out.println("Display Stop");
}
}
class SoundCard implements PCI
{
public void start()
{
System.out.println("Sound...");
}
public void stop()
{
System.out.println("Sound Stop");
}
}
class MainBoard
{
public void usePCICard(PCI p)
{
p.start();
p.stop();
};
}
class Assemble
{
public static void main(String args[])
{
MainBoard mb=new MainBoard();
DisplayCard dc=new DisplayCard();
SoundCard sc=new SoundCard();
mb.usePCICard(dc);
mb.usePCICard(sc);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -