Ich hab da wohl was falsch gemacht. Compiliert fehlerfrei, aber läuft noch nicht.
Exception in thread "main" java.lang.NoSuchMethodError: main
Edit von L-ectron-X: Code-Tags repariert
Exception in thread "main" java.lang.NoSuchMethodError: main
Code:
import java.io.*;
public class Licht
{ // public static void main(String args[]) throws IOException
public static void main() throws IOException
{
int i = 0, n = 10;
float[] Feld1 = new float[n];
einlesen(Feld1);
for (i=0; i<=n; i++)
{
System.out.println("Feld1[" + i + "] = " + Feld1[i]);
}
}
static void einlesen (float[] Feld) throws IOException
{
String thisLine;
int i = 0;
File file = new File ("c:\\JavaDaten.txt");
FileReader fr = new FileReader(file);
BufferedReader in = new BufferedReader (fr);
while( (thisLine = in.readLine()) != null )
{
System.out.println("#"+thisLine+"#");
Feld[i] = Float.parseFloat(thisLine);
i = i + 1;
}
in.close();
}
}
Edit von L-ectron-X: Code-Tags repariert