0

What should i do if i want to change to this method

https://code.sololearn.com/cQslRC7uC87y/?ref=app Circle a = new Circle(2); Circle b = new Circle(3);

24th May 2020, 9:47 PM
Kyrene
2 Answers
+ 1
public Circle(int radius) { this.Radius = radius; } If radius shall be optional, you can add another constructor without arguments or: public Circle(int radius = 1) { this.Radius = radius; }
24th May 2020, 9:56 PM
Manu_1-9-8-5
Manu_1-9-8-5 - avatar
0
Kyrene the constructors do not accept an argument and collapse and defining the radius' fails.
24th May 2020, 9:54 PM
BroFar
BroFar - avatar