Commit ee618fb1 by Patryk Czarnik

ktoraGodzina i oblicz

parent 2052de65
package hello;
import java.time.LocalDateTime;
import javax.jws.WebService;
@WebService
......@@ -9,4 +11,17 @@ public class PierwszySerwis {
return "Witaj " + imie;
}
public String ktoraGodzina() {
return LocalDateTime.now().toString();
}
public long oblicz(long x, long y, String operacja) {
switch(operacja) {
case "+": return x + y;
case "-": return x - y;
case "*": return x * y;
case "/": return x / y;
default: throw new IllegalArgumentException("Nieznana operacja " + operacja);
}
}
}
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