Commit 79ed24f1 by Patryk Czarnik

usunięcie throws

parent ec882af2
......@@ -48,7 +48,7 @@ class Konto {
saldo -= kwota;
}
public synchronized void wyplataCzekaj(int kwota) throws BrakSrodkow {
public synchronized void wyplataCzekaj(int kwota) {
if(kwota < 0) {
throw new IllegalArgumentException("Ujemna kwota " + kwota + " w wypłacie");
}
......
......@@ -28,11 +28,7 @@ class WyplacanieZOczekiwaniem {
Thread wyplacacz = new Thread(new Runnable() {
public void run() {
while (!koniec) {
try {
konto.wyplataCzekaj(100);
} catch (BrakSrodkow e) {
System.err.println("BRAK ŚRODKÓW");
}
System.out.println("wypłacacz: wypłaciłem 100, saldo = " + konto.getSaldo());
try {
Thread.sleep(200);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment