Write a program that reads the contents of the two files into two separate arrays, or ArrayLists. The user should be able to enter a boy’s name, or a girl’s name, or both, and the application will display a message indicating whether the names were among the most popular.
The exercises will use two files:
GirlNames.txt - this file contains a list of the 200 most popular names given to girls born in the United States for the years 2000 through 2009.
BoysNames.txt - this file contains a list of the 200 most popular names given to boys born in the United States fro the years 2000 through 2009.
In the code below we will read a text file using java 8 retrieving the names from the two files creating an associated arraylist for girls and boys names. We will then search for the name entered in each of lists using a lambda expression and java 8's stream anyMatch method.
Breaking it down
Output
Level Up
Modify the program to to allow users to enter in multiple names seperated by a comma as input. Refernece split a string by a comma.