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 y;
char z;
boolean a;
ClassCanBeTyped b;
public ClassCanBeTyped(int x) {
this.x = x;
@ -12,8 +10,13 @@ public class ClassCanBeTyped {
this.x = x;
this.y = y;
}
public ClassCanBeTyped initClassCanBeTyped(int x, int y) {
b = new ClassCanBeTyped(x, y);
public ClassCanBeTyped initClassCanBeTyped(int x) {
int a;
a = 10;
b = new ClassCanBeTyped(x);
b.x = 10 + a;
b.y = 20;
return b;
}
public ClassCanBeTyped init(int x, int y) {