File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/java/com/booleanuk/core Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -51,20 +51,24 @@ 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+ this .name = name ;
56+ this .age = age ;
57+ }
5458
5559
5660
5761 /*
5862 2. Create a method named add that accepts two integers. The method should return the numbers added together.
5963 */
60-
64+ public int add ( int n1 , int n2 ) { return n1 + n2 ; }
6165
6266
6367 /*
6468 3. Create another method named add that accepts two Strings. The method should return the strings concatenated
6569 together with a space in between.
6670 */
67-
71+ public String add ( String s1 , String s2 ) { return s1 + " " + s2 ; }
6872
6973
7074}
You can’t perform that action at this time.
0 commit comments