fork(1) download
  1. class Feline {
  2. public String type = "f ";
  3. public Feline() {
  4. System.out.print("feline ");
  5. }
  6. }
  7. class Cougar extends Feline {
  8. public String type = "c ";
  9. public Cougar() {
  10. System.out.print("cougar ");
  11. }
  12. public static void main(String[] args) {
  13. new Cougar().go();
  14. }
  15. void go() {
  16. System.out.print(this.type + super.type);
  17. }
  18. }
Success #stdin #stdout 0.05s 4575232KB
stdin
Standard input is empty
stdout
feline cougar c f