JavaRush/Courses/New Java Syntax/Practice with constructors

Practice with constructors

Open

"I can see that you've already rested. Great! Here are some tasks to practice creating constructors:"

10
Task
New Java Syntax,  10 level,  6 lecture
Locked
You can't buy friends
You can't buy friends
10
Task
New Java Syntax,  10 level,  6 lecture
Locked
The basis of a wheel
The basis of a wheel
10
Task
New Java Syntax,  10 level,  6 lecture
Locked
Populate the Rectangle class
Populate the Rectangle class
10
Task
New Java Syntax,  10 level,  6 lecture
Locked
Constructor
Constructor
10
Task
New Java Syntax,  10 level,  6 lecture
Locked
Creating cats
Creating cats
10
Task
New Java Syntax,  10 level,  6 lecture
Locked
Calling a constructor from a constructor
Calling a constructor from a constructor
10
Task
New Java Syntax,  10 level,  6 lecture
Locked
Max constructors
Max constructors
Комментарии (2)
  • популярные
  • новые
  • старые
Для того, чтобы оставить комментарий Вы должны sign in
Dmitri Telinov
Уровень 5
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) { ...}
Daniel Alien
Уровень 21
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.