fork download
  1. class Base {
  2. public Base() {
  3. test();
  4. }
  5.  
  6. public void test() {
  7. System.out.println("base");
  8. }
  9. }
  10.  
  11. class Derived extends Base {
  12. public void test() {
  13. System.out.println("derived");
  14. }
  15. }
  16.  
  17. public class Main {
  18. public static void main(String[] args) {
  19. new Derived();
  20. }
  21. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
derived