fork download
  1. class Base {
  2. Base(int num) { System.out.println("Base num = " + num); }
  3. }
  4.  
  5. class Sub extends Base {
  6. Sub(int num) { Base(num + 77); }
  7. }
  8.  
  9. class Main {
  10. public static void main(String[] args) {
  11. Base b = new Base(123);
  12. };
  13. }
  14.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:6: error: constructor Base in class Base cannot be applied to given types;
  Sub(int num) { Base(num + 77); }
               ^
  required: int
  found: no arguments
  reason: actual and formal argument lists differ in length
Main.java:6: error: cannot find symbol
  Sub(int num) { Base(num + 77); }
                 ^
  symbol:   method Base(int)
  location: class Sub
2 errors
stdout
Standard output is empty