class Test
{
int b=2;
Test()
{
method();
method2();
// System.out.println("b2:"+b);
}
public void method()
{
System.out.println("b1:"+b);
}
public void method2()
{
System.out.println("b2:"+b);
}
}
public class TestB extends Test{
int b=20;
TestB()
{
super();
System.out.println("b4:"+b);
//b++;
}
public void method()
{
System.out.println("b3:"+b);
}
public static void main(String args[])
{
new TestB();
}
}
class MainBoard
{
public void run()
{
System.out.println(" run ");
}
public void userPCI(PCI P) //PCI p = new NetCard()
{
if(p!=null)
{
p.open();
p.close();
}
}
}
class NetCard implements PCI
{
public void open()
{
System.out.println(" open ");
}
public void close ()
{
System.out.println(" close ");
}
}
class Demo
{
public static void main(String args[])
{
MainBoard mb = new MainBoard();
mb.run();
mb.userPCI(null);
mb.userPCI(new NetCard() );