class Main {
public static void main(String[] args) {
int[] tage = new int[7]; //später durch 365 ersetzen
for (int i=0; i< tage.length; i++)
{
tage[i] = i;
System.out.println( tage[i]); //nur zur Überprüfung
}
}
}
Dann wird auch nichts ausgeführt, wie in #5 und #7 geschrieben.Weiter oben habe ich schon eine main-Methode, allerdings auskommentiert.
keine main Methode benötigt
Diese Vermutungen sind für BlueJ (Version 5.0 als Testobjekt) richtig, siehe https://www.java-tutorial.org/projekt-ausfuehrung-mit-bluej.html :wahrscheinlich irgendwo anders
public class Blatt11 {
private int[] tage = null;
public Blatt11() {
initArray();
fillArray();
printArray();
}
private void initArray() {
tage = new int[365];
}
private void fillArray() {
for (int i = 0; i < tage.length; i++) {
tage[i] = i + 1;
}
}
private void printArray() {
for (int i = 0; i < tage.length; i++) {
System.out.println(tage[i]);
}
}
public static void main(String[] args) {
Blatt11 blatt11 = new Blatt11();
}
}