如何做一个数组的联系人?那么如何放入字符串并使用“$”作为分隔符?
在主类中制作一个联系人数组,输入联系人。键入后将数据放入字符串中,使用“$”作为分隔符
public class Contato {
private String name;
private String address;
private String numerophone;
public void setName(String name) {
this.name = name;
}
public void setAddress(String address){
this.address = address;
}
public void setTelefone(String numerophone) {
this.numerophone = numerophone;
}
public String getName() {
return name;
}
public String getAddress() {
return address;
}
public String numerophone() {
return numerophone;
}
@Override
public String toString() {
return "name: " + this.name + " address : " + this.address + " fone : " + this.numerophone;
}
}