Exercise 12.31 and displays the names that are used for
both genders in the file. Here is a sample run:
<Output>
Hint: There are many ways to get the common elements from
the two lists. Most simple way is to use the retainAll
method from an ArrayList. Please look for the information
on how to use the retainAll method from the Java API.
*12.2 (Sort names without duplicates) Write a program that
reads the names from the all the ten files described in
Exercise 12.31, sorts all names (boy and girl names
together, duplicates removed), and stores the sorted names
in one file ten per line.
*12.3 (Sort names with duplicates) Write a program that
reads the names from the all the ten files described in
Exercise 12.31, sorts all names (boy and girl names
together, duplicates allowed), and stores the sorted names
in one file ten per line.
*12.4 (Cumulative ranking) Write a program that obtains the
cumulative ranking for the names in the ten years using the
ranking for each row. The new file is named as the input
file with the extension .new.
*12.6 (Rename files using current date/time) Write a
program that renames a file name. The program checks
whether the file exists. If so, change the file name by
appending the date and time to the file. Pass the filename
from the command line. Here is a sample run:
<Output>