I'm still learning the basics of coding in Java and have moved onto using methods which has thrown me. My issue is nothing is being returned to the console and I have no idea why. Here's my code:
public class MethodsPractice {
public int returnInteger (int num1, int num2){
return num1 + num2;
}
public String[] upperCaseString(String[] strings){
String[] upperStrings = new String[strings.length];
for (int i = 0; i < strings.length; i++){
upperStrings[i] = strings[i].toUpperCase();
}
return upperStrings;
}
public static void main(String[] args) {
MethodsPractice myMethods = new MethodsPractice();
int result = myMethods.returnInteger (10,20);
String[] names = {"Bob", "Alex", "Luke"};
String[] newNames = myMethods.upperCaseString(names);
}
}