1234567891011121314151617181920212223 |
- import java.util.ArrayList;
- import java.util.List;
- public class Entry
- {
- String name;
- String phoneNumber;
- List<String> entryArray = new ArrayList <String>();
-
- public Entry(String phoneNumber){
- entryArray.add(0,phoneNumber);
- }
-
- public String getPhoneNumber(){
- StringBuilder phoneNumber = new StringBuilder();
- for(int i = 0; i < entryArray.size(); i++){
- phoneNumber.append(entryArray.get(i));
- if(entryArray.size() > 1){
- phoneNumber.append(", ");
- }
- }
- return phoneNumber.toString();
- }
- }
|