Hello all, one of the conditions for my assessment is that I shouldnt't be re-using code that is similar/same as previously used in my program. I've got "re-used" code everywhere, but not sure how to make it so that its not the same line of code with one word changed. An example below :
How would I shorten that method so that I'm not repeating code?
Code:
void getInput()
{
System.out.print("Enter Australia player name: ");
australiaPlayerName = input.next();
System.out.print("Enter Africa player name: ");
africaPlayerName = input.next();
}
Comment