6
#include <iostream.h>
class A {
public:
A() {cout << "A::A()" << endl; }
A(int i) {cout << "A::A(int)" << endl;}
~A() {cout << "A::~A()" << endl;}
};
class B: public A {
public:
B():A(0) {cout << "B::B()" << endl; }
B(int i) {cout << "B::B(int)" << endl;}
~B() {cout << "B::~B()" << endl;}
};
class C: public B {
public:
C() {cout << "C::C()" << endl; }
C(int i):B(i) {cout << "C::C(int)" << endl;}
~C() {cout << "C::~C()" << endl;}
};
void main ()
{
C c1(0), c2;
}
import java.lang.*;
class A {
public A()
{ System.out.println("A.A()"); }
public A(int i)
{ System.out.println("A.A(int)"); }
}
class B extends A {
public B()
{super(0);System.out.println("B.B()"); }
public B(int i)
{System.out.println("B.B(int)"); }
}
class C extends B {
public C()
{ System.out.println("C.C()"); }
public C(int i)
{super(i);System.out.println("C.C(int)");}
}
public class Konstr {
public static void main (String args[])
{C c1=new C(0), c2=new C(); }
}