Nie wiem czemu wyskakuje mi taki błąd:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method toString(long[]) in the type Arrays is not applicable for the arguments (List<Produkt>)
public class Lodowka {
List<Produkt> lodowka = new ArrayList<Produkt>();
Produkt produkt = new Produkt();
public void ladujeDomyslneKrokiety() {
lodowka.add(new Produkt(12345, "krokiety z gyrrrrrosem", 3.0, 20));
lodowka.add(new Produkt(13254, "krokiety z majonezem", 3.5, 20));
}
public void pokazZawartoscLodowki() {
System.out.println(Arrays.toString(lodowka));
}
}
public class Produkt {
private int kodKreskowy;
private String nazwa;
private double cena;
private int ilosc;
public Produkt(int kodKreskowy, String nazwa, double cena, int ilosc) {
this.kodKreskowy = kodKreskowy;
this.nazwa = nazwa;
this.cena = cena;
this.ilosc = ilosc;
}
public Produkt() {
super();
}
public int getKodKreskowy() {
return kodKreskowy;
}
public String getNazwa() {
return nazwa;
}
public double getCena() {
return cena;
}
public int getIlosc() {
return ilosc;
}
public void setIlosc(int ilosc) {
this.ilosc = ilosc;
}
// public String toString() {
// return "Lodowka [lodowka=" + getNazwa() + getKodKreskowy() + getIlosc() +
// getCena();
// }
public String toString() {
return nazwa + " " + kodKreskowy + " " + cena + " " + ilosc;
}
}