Dlaczego podczas wykonywania tej metody wyrzuca mi ten wyjątek?
void nowaDostawa(){
PrintWriter wyj = new PrintWriter(System.out, true);
Scanner wej = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
wyj.printf("Podaj nazwę dostawcy : ");
String dostawca = wej.next();
wyj.printf("Podaj nazwę towaru : ");
String towar = wej.next();
wyj.printf("Podaj ilość towaru : ");
double ilosc = wej.nextDouble();
wyj.printf("Podaj cenę towaru : ");
double cena = wej.nextDouble();
dost[licDost] = new Dostawca(dostawca);
dost[licDost].tow.add(new Towar(towar, ilosc, cena));
licDost++;
wyj.close();
wej.close();
}
Co jest źle ze Scannerem?