G
Guest
Gast
Der Kompiler meldet einen Fehler für die Zeilen 13 und 24...
Can not not find class symbol string, new string[7]
Can not find variable in1.
Can not not find class symbol string, new string[7]
Can not find variable in1.
Code:
import java.io.*;
public class AfiRead4 {
// Main
public static void main(String[] args) {
AfiRead4 dl = new AfiRead4();
PrtDet();
}
// Load Records in Array
public AfiRead4() {
String ArrayInno[] = new string [7];
String satz1;
int idx = 1;
try {
BufferedReader in1 = new BufferedReader(new FileReader("VendingMachines.txt"));
}
catch(FileNotFoundException fnfe) {
System.out.println("Datei VendingMachines.txt nicht gefunden!");
}
while((satz1 = in1.readLine()) != null)
{
try {
ArrayInno[idx] = satz1.substring(1,6);
System.out.println("Array: " + ArrayInno[idx]);
}
catch(StringIndexOutOfBoundsException s) {
System.out.println("Fehler bei SubString! Array..." + satz1);
}
idx ++;
}
}
// Print Detail
public static void PrtDet() {
try {
BufferedReader in2 = new BufferedReader(new FileReader("AFI.DE1"));
String satz2, inno, strmano;
int idx;
while((satz2 = in2.readLine()) != null) // Loop1
{
try {
strmano = satz2.substring(6,12);
if (strmano.equals("A MANO")) {
idx = 1;
inno = satz2.substring(13,19);
System.out.println("Objekt: " + satz2);
while((satz2 = in2.readLine()) != null) // Loop 2
{
try {
strmano = satz2.substring(6,12);
}
catch(StringIndexOutOfBoundsException s) {
System.out.println("Fehler bei SubString!" + satz2);
}
// satz = in.readLine();
// System.out.println(idx + " " + satz2);
idx ++;
if (strmano.equals("E MANO")) {
break;
}
}
// End Loop Read Detail Records
System.out.println("E N D E: " + "Objekt: " + inno + "-----------");
System.out.println(" ");
}
}
catch(StringIndexOutOfBoundsException s) {
//System.out.println("Fehler bei SubString!");
}
}
}
catch(FileNotFoundException fnfe) {
System.out.println("Datei nicht gefunden!");
}
catch(IOException ioe) {
System.out.println("Fehler beim Lesen!");
}
}
}