Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/main/java/com/booleanuk/core/Exercise.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,20 @@ public Exercise(int age) {
Create a constructor that accepts both a String and an int as parameters, in that order, and assign the values
provided to the name and age members
*/
public Exercise(String name, int age)
{
this.name = name;
this.age = age;
}



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



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

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



}
Loading