fork download
  1. class A{
  2. protected int i;
  3. A(){};
  4. A(int i){
  5. this.i = i;
  6. }
  7. void print(){
  8. System.out.println("i = "+i);
  9. }
  10. }
  11. class B extends A{
  12. private int j;
  13. B(int i,int j){
  14. // super(i);
  15. this.j = j;
  16. }
  17. void print(){
  18. System.out.println("i = "+i+", j = "+j);
  19. }
  20. }
  21. class C{
  22. public static void main(String args[]){
  23. B a = new B(10,20);
  24. a.print();
  25. }
  26. }
Success #stdin #stdout 0.1s 321600KB
stdin
Standard input is empty
stdout
i = 0, j = 20