java basics --- Interface

interface USB // Rules
{
public void Open ();
public void Close ();
}
class Bookpc
{
public static void main (String [] args)
{
useUSB (Upan new new);
}
// usage rule
public static void useUSB (USB U)
{
u.open ();
u.closr ();
}
}
// implement rules
// these coupling devices and computers reduced
class Upan the implements the USB
{
public void Open ()
{

}
public void Close ()
{

}
}
class Mose the implements US
{
public void
}

Reproduced in: https: //www.cnblogs.com/postmaster/archive/2012/09/23/2698912.html

Guess you like

Origin blog.csdn.net/weixin_34337381/article/details/93507518