Practice with constructors
Комментарии (2)
- популярные
- новые
- старые
Для того, чтобы оставить комментарий Вы должны sign in
Dmitri Telinov
18 December 2025, 18:20
The fourth contructor should be:
public Circle(Circle oc) {
this(oc.x, oc.y, oc.radius);
}
but instead of it - in solution it is:
public Circle(double x) {
...}
0
Daniel Alien
2 December 2025, 18:07
Interesting fact: If a class doesn't declare any constructors, the Java compiler automatically provides a default constructor (a no-argument constructor) for us. However, if there is any declared constructor, the compiler will not provide the default one.
+1