📄 main.java
字号:
/*
* Main.java
*
* Created on 2007年7月27日, 下午8:42
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package pci;
/**
*
* @author Administrator
*/
public class Main {
/** Creates a new instance of Main */
public Main() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
MainBoard m=new MainBoard();
NetworkCard n=new NetworkCard();
SoundCard s=new SoundCard();
m.usePCICard(n);
m.usePCICard(s);
// TODO code application logic here
}
}
interface PCI
{
void start();
void stop();
}
class NetworkCard implements PCI
{
public void start()
{
System.out.println("Network is starting!");
}
public void stop()
{
System.out.println("it is stop!");
}
}
class SoundCard implements PCI
{
public void start()
{
System.out.println("it's begin!");
}
public void stop()
{
System.out.println("Du du");
}
}
class MainBoard
{
public void usePCICard(PCI p)
{
p.start();
p.stop();
}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -