Class Auto
{
public static void main (String args[])
{
int predkosc;
Auto audi = new Auto()
audi.predkosc = 100;
System.out.print ("prędkość auta wynosi " + audi.predkosc);
}
}
Uczę się. Utworzyłem obiekt Auto i zapisałem go w zmiennej audi. Stworzylem pole prędkość. Przypisalem pole do obieku. Ale to nie działa. Dlaczego.?