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