Skip to content

Commit ccadee2

Browse files
Lowe RaivioLowe Raivio
authored andcommitted
all test pass
1 parent e19b26f commit ccadee2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/com/booleanuk/core/Exercise.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,20 @@ public Exercise(int age) {
5151
Create a constructor that accepts both a String and an int as parameters, in that order, and assign the values
5252
provided to the name and age members
5353
*/
54+
public Exercise(String name, int age)
55+
{
56+
this.name = name;
57+
this.age = age;
58+
}
5459

5560

5661

5762
/*
5863
2. Create a method named add that accepts two integers. The method should return the numbers added together.
5964
*/
65+
public int add(int a, int b){
66+
return a + b;
67+
}
6068

6169

6270

@@ -65,6 +73,10 @@ public Exercise(int age) {
6573
together with a space in between.
6674
*/
6775

76+
public String add(String a, String b){
77+
return a + " " + b; // String.format would look nicer...
78+
}
79+
6880

6981

7082
}

0 commit comments

Comments
 (0)