import easyIO.*;
class Oblig3A {
public static void main(String[] args) {
OrdAnalyse oA = new OrdAnalyse(args[0]);
oA.textLeser();
} //closes main
} //closes Oblig3 class
class OrdAnalyse {
String[] ord = new String[5000];
int[] antall = new int[5000];
int antUnik = 0;
String argu;
OrdAnalyse(String file){
argu = file;
} //args relay
void textLeser(){
In lesText = new In(argu);
Out nyText = new Out("oppsummering.txt" , true);
while (!lesText.endOfFile()) {
String reader = lesText.inWord();
for(int i=0; i<ord.length; i++) {
if(reader.equals(ord[i])) {
antall[i]++;
antUnik++;
ord[i] = reader;
nyText.out(ord[i]);
} //if
else {
antall[i]++;
} //else
} //for
}//while
}//textLeser
}//OrdAnalyse.class
誰でも間違っていることを見つけることができますか? :S 助けが必要です。
何が悪いのかわからないので、いろいろ試してみました。:/
それがなぜなのかはわかりません:s
33 行目 = if(reader.equals(ord[i])) {