Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

0 votes
20 views
asked by Expert (15k points) 15 23 32

1 Answer

0 votes
class A {
  A(int i) {
    System.out.println("A constructor");
  }
}

class B extends A {
  B(int i) {
    super(i);
    System.out.println("B constructor");
  }
}

class C extends B {
  C() {
    super(11);
    System.out.println("C constructor");
  }
}

public class MainClass {
  public static void main(String[] args) {
    C x = new C();
  }
}
output
A constructor
B constructor
C constructor
answered by Geek (15.3k points) 19 43 70

Related questions

0 votes
1 answer 39 views
39 views asked by augustaina Sr Member (4.8k points) 10 26 32
0 votes
1 answer 28 views
28 views asked by augustaina Sr Member (4.8k points) 10 26 32
0 votes
1 answer 26 views
0 votes
1 answer 49 views
0 votes
1 answer 20 views
20 views asked by augustaina Sr Member (4.8k points) 10 26 32
...