Question
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
mport java.io.*;import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class MeetingRoom {
public Map<String, String> names;
public MeetingRoom()
{
names = new HashMap<String, String>();
try(BufferedReader out = new BufferedReader(new FileReader("contacts.txt")))
{
String line;
while((line = out.readLine()) != null)
{
String[] split = line.split("\\s+");
names.put(split[0], split[1]);
}
} catch (IOException e) {
return;
}
}
public boolean addEntry(String name, String phoneNumber)
{
if(!names.containsKey(name))
{
names.put(name, phoneNumber);
return true;...