Updated the ClassCanBeTyped

This commit is contained in:
ahmad 2024-05-11 17:15:14 +02:00
parent 6fcf183bc8
commit ba97c04414

View File

@ -2,8 +2,6 @@ public class ClassCanBeTyped {
int x; int x;
int y; int y;
char z;
boolean a;
ClassCanBeTyped b; ClassCanBeTyped b;
public ClassCanBeTyped(int x) { public ClassCanBeTyped(int x) {
this.x = x; this.x = x;
@ -12,8 +10,13 @@ public class ClassCanBeTyped {
this.x = x; this.x = x;
this.y = y; this.y = y;
} }
public ClassCanBeTyped initClassCanBeTyped(int x, int y) { public ClassCanBeTyped initClassCanBeTyped(int x) {
b = new ClassCanBeTyped(x, y); int a;
a = 10;
b = new ClassCanBeTyped(x);
b.x = 10 + a;
b.y = 20;
return b; return b;
} }
public ClassCanBeTyped init(int x, int y) { public ClassCanBeTyped init(int x, int y) {