ArrayList<String> list = new ArrayList<String>();
list.add("ich wurde hinzugefügt");
list.set(0,"jetzt bin ich geändert worden");
list.get(0) = "jetzt bin ich geändert worden";
Hihi, habs schon vor ner ganzen Minute geändertNe bist du nicht :bae:Java:list.get(0) = "jetzt bin ich geändert worden";
Das kannst du so nicht kompilieren![]()
die gehört zu eine Klasse WordCountArray, und die Attributen sind String word und int count.
Es gibt noch eine andere Klasse WordCount, die diese Attribute enthält und die müssen zu WorCountArray hinzufügt werden.
public class WordCount {
private String word;
private int count;
public WordCount(String word, int count) {
this.word = word;
this.count = count;
}
public String getWord() {
return word;
}
public int getCount() {
return count;
}
}
public class WordCountArray {
WordCountArray[] w = new WordCount[n];
public WordCountArray(int maxSize){
int[] maxSize;
}
public void add(String word, int count){
}
public class WordCount {
private String word;
private int count;
public WordCount(String word, int count) {
this.word = word;
this.count = count;
}
public String getWord() {
return word;
}
public int getCount() {
return count;
}
}
ArrayList<WordCount> list = new ArrayList<WordCount>();
list.add(new WordCount("String",727));
public WordCount(String word, int count) {
this.word = word;
this.count = count;
}
War einfach nur ein Beispiel von StupidAttack, schätze ichaber woher kommt 727??