Hi!
Can't seem to manage the following code:
public class Expert extends User {
private String category;
private int categoryIndex;
public Expert(String aName, int aUserID,
String aTelephoneNo, String category) {
super(aName, aUserID, aTelephoneNo);
this.category = category;
}
private List categoryList = new ArrayList();
public String getCategory(int categoryIndex) {
String empty = "";
for (int i = 0; i < categoryList.size(); i++) {
if(i==categoryIndex) {
empty = "" + categoryList.get(i);
}
}
return empty;
}
public void setCategory(String category) {
this.category = category;
}
public String toString() {
return super.toString() + "\tCategory: " + category;
}
}
Any help would be greatly appreciated.
Thanks!
Can't seem to manage the following code:
public class Expert extends User {
private String category;
private int categoryIndex;
public Expert(String aName, int aUserID,
String aTelephoneNo, String category) {
super(aName, aUserID, aTelephoneNo);
this.category = category;
}
private List categoryList = new ArrayList();
public String getCategory(int categoryIndex) {
String empty = "";
for (int i = 0; i < categoryList.size(); i++) {
if(i==categoryIndex) {
empty = "" + categoryList.get(i);
}
}
return empty;
}
public void setCategory(String category) {
this.category = category;
}
public String toString() {
return super.toString() + "\tCategory: " + category;
}
}
Any help would be greatly appreciated.
Thanks!