package infacepci;
interface infacepci
{
void star();
void stop();
}
package infacepci;
class netWork implements infacepci
{
public void star()
{
System.out.println("网卡启动");
System.out.println("--------");
}
public void stop()
{
System.out.println("网卡断开");
System.out.println("--------");
}
}
package infacepci;
class soundCar implements infacepci
{
public void star()
{
System.out.println("声卡启动");
System.out.println("--------");
}
public void stop()
{
System.out.println("声卡停止");
System.out.println("--------");
}
}
package infacepci;
class main
{
public void starPci(infacepci p)
{
p.star();
}
public void stopPci(infacepci s)
{
s.stop();
}
}
package infacepci;
public class infacedemo
{
public static void main (String[] args)
{
//System.out.println("启动主板");
//初始化主板
main board = new main();
//初始化网卡
netWork nw = new netWork();
System.out.println("启动网卡");
board.starPci(nw);
//初始化声卡
soundCar sc = new soundCar();
System.out.println("启动声卡");
board.starPci(sc);
System.out.println("");
//停止设备
board.stopPci(nw);
board.stopPci(sc);
}
}
正好手上有一个描述主板上PCI接口的接口程序,不过是JAVA的……凑合着看吧。-_-!