This commit is contained in:
Rémi Heredero 2021-12-01 16:54:01 +01:00
parent a7eda55e9b
commit 7a0d8f3cca
2 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,8 @@ public class Rectangle {
} }
public String toString(){ public String toString(){
String s = "Rectangle size : "; String s = "";
s += "Rectangle size : ";
s += this.width; s += this.width;
s += " x "; s += " x ";
s += this.height; s += this.height;

View File

@ -5,7 +5,7 @@ import java.awt.Color;
public class Task1Runner { public class Task1Runner {
public static void main(String[] args) { public static void main(String[] args) {
Rectangle r1 = new Rectangle (10, 5); Rectangle r1 = new Rectangle(10, 5);
Rectangle r2 = new Rectangle (3, 4); Rectangle r2 = new Rectangle (3, 4);
Rectangle r3 = new Rectangle (100, 100); Rectangle r3 = new Rectangle (100, 100);