I have a question regarding a programming and i don't know how to solve it.
I have 3 strings which is sensed by the input of a user.
As an example:
Scanner keyscan = new Scanner(System.in);
System.outprint("Team 1 ");
String team1 = keyscan.nextline();
System.outprint("Team 2 ");
String team2 = keyScan.nextline();
System.outprint("Team 3 ");
String team3 = keyScan.nextline();
int identical = 0;
I am trying to get the number of identical names printed as a number.
team1 contains the following string "Mike, Steve, Steve, Obama". So Steve appears here 2 times. Then the output should simply be 2.
How can I program this?
Thanks a lot!