SSISO Community

시소당

Java annotation: Super Sub Tester

import  java.io.*;

public  class  SuperSubTester  {

    public  static  void  main(String[]  args)  {
        try  {
            Sub  sub  =  new  Sub();
            sub.print(System.out);
        }  catch  (Exception  e)  {
            e.printStackTrace();
        }
    }
}

class  Sub  extends  Super  {

    public  void  print(PrintStream  out)  throws  IOException  {
        out.println("Sub  printing...");
    }
}

@InProgress  class  Super  {

    public  void  print(PrintStream  out)  throws  IOException  {
        out.println("Super  printing...");
    }
}

692 view

4.0 stars