subject
Computers and Technology, 13.10.2020 01:01 rama64

JAVA ECLIPSE Write a class named PhoneBookEntry that has fields for a person's name and phone number. The class should have a constructor and appropriate accessor and mutator methods. Then write a program that creates at least five PhoneBookEntry objects and stores them in an ArrayList. use a loop[ to display the contents of each object in the ArrayList.
There this code:
import java. util.*;
public class PhoneBookEntry {
private String name;
private String number;
public PhoneBookEntry(String name, String number) {
this. name=name;
this. number=number;
}
public String getName() {
return name;
}
public void setName(String name) {
this. name = name;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this. number = number;
}
public static void main(String[] args) {
List phoneList = new ArrayList();
phoneList. add(new PhoneBookEntry("John Smith","818.555.1234"));
phoneList. add(new PhoneBookEntry("Jane Brown","818.555.1235"));
phoneList. add(new PhoneBookEntry("Jose Vargas","818.555.1236"));
phoneList. add(new PhoneBookEntry("Armen Avetian","818.555.1237"));
phoneList. add(new PhoneBookEntry("Xin Liu","818.555.1238"));
phoneList. add(new PhoneBookEntry("James White","818.555.1239"));
phoneList. add(new PhoneBookEntry("Julie McGuiness","818.555.1240"));
phoneList. add(new PhoneBookEntry("Juan Ballardos","818.555.1241"));
phoneList. add(new PhoneBookEntry("Arthur London","818.555.1242"));
phoneList. add(new PhoneBookEntry("Ashot Aghajanian","818.555.1243"));
for (PhoneBookEntry entry : phoneList) {
System. out. println(entry. getName()+" "+entry. getNumber());
}
}
}

Gives me this output:
John Smith 818.555.1234
Jane Brown 818.555.1235
Jose Vargas 818.555.1236
Armen Avetian 818.555.1237
Xin Liu 818.555.1238
James White 818.555.1239
Julie McGuiness 818.555.1240
Juan Ballardos 818.555.1241
Arthur London 818.555.1242
Ashot Aghajanian 818.555.1243

I would like to get the output like this:
First Name: John\n
Last Name: Smith\n
Phone Number: 818.555.1234\n
\n
First Name: Jane\n
Last Name: Brown\n
Phone Number: 818.555.1235\n
\n
First Name: Jose\n
Last Name: Vargas\n
Phone Number: 818.555.1236\n
\n
First Name: Armen\n
Last Name: Avetian\n
Phone Number: 818.555.1237\n
\n
First Name: Xin\n
Last Name: Liu\n
Phone Number: 818.555.1238\n
\n
First Name: James\n
Last Name: White\n
Phone Number: 818.555.1239\n
\n
First Name: Julie\n
Last Name: McGuiness\n
Phone Number: 818.555.1240\n
\n
First Name: Juan\n
Last Name: Ballardos\n
Phone Number: 818.555.1241\n
\n
First Name: Arthur\n
Last Name: London\n
Phone Number: 818.555.1242\n
\n
First Name: Ashot\n
Last Name: Aghajanian\n
Phone Number: 818.555.1243\n
\n

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:00
Match each vocabulary word to its definition.1. desktoppicture used to represent acomputer application2. domainnetwork protectionsoftware code that can be viewed,3. iconmodified, and redistributed for freethe background screen on acomputer monitor4. url5. blogan online journalthe part of an internet address that6. firewallrefers to a group of computers on anetworkonline database of web pages7. intranetnetwork for use by an individual8. open address of a web page or9. wikiresource
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
Suppose you have 9 coins and one of them is heavier than others. other 8 coins weight equally. you are also given a balance. develop and algorithm to determine the heavy coin using only two measurements with the of the balance. clearly write your algorithm in the form of a pseudocode using the similar notation that we have used in the class to represent sorting algorithms
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Which of the following tasks is an audio technician most likely to perform while working on a nature documentary? (select all that apply). eliminating potentially distracting background noise adding sound effects making sure the lighting is adequate for a particular scene changing the narration to better match the mood of the documentary
Answers: 3
question
Computers and Technology, 24.06.2019 11:30
What does the https: // mean when you type in a website
Answers: 1
You know the right answer?
JAVA ECLIPSE Write a class named PhoneBookEntry that has fields for a person's name and phone numbe...
Questions
question
Social Studies, 11.10.2021 18:40
question
Biology, 11.10.2021 18:40
question
Mathematics, 11.10.2021 18:40
question
Physics, 11.10.2021 18:40
question
Mathematics, 11.10.2021 18:40
Questions on the website: 13722361