Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A extends Object {
- public int x;
- private C y = new C();
- public A (C u) {
- x = this.y.x + 2;
- y = u;
- }
- public int add(int u) {
- this.x = 2*this.x+u;
- }
- }
- class B extends A {
- public int x = 0;
- public B (C u) {
- super(u);
- }
- public B () {
- this.x = 10;
- }
- public int add(int u) {
- this.x = u;
- }
- }
- class C extends Object {
- public int x = 7;
- C () {}
- }
- A z = new B(new C())
- int w = z.x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement