Witam
Mam problem z utworzeniem obiekty typu tablicowego, który będzie za pomocą tej tablicy przechowywał inne obiekty.
mój kod:
public class Test {
public int ilosc;
public int[] tablica;
public Test (int ilosc ){
this.tablica = new int[ilosc];
}
public static void main(String[] args) {
Test t1 = new Test(5);
t1[0] = 2; // w tej lini mam błąd: Exception in thread "main" java.lang.Error: Unresolved compilation problem:
// The type of the expression must be an array type but it resolved to Test
}