Commit 70180e3a by Patryk Czarnik

web serwisy - klasa Hello

parent 16d43b47
package hello;
import java.time.LocalDateTime;
import jakarta.jws.WebService;
@WebService
public class Hello {
public String sayHello(String imie) {
return "Witaj " + imie;
}
public String currentTime() {
return LocalDateTime.now().toString();
}
public long oblicz(long liczba1, long liczba2, String operacja) {
return switch(operacja) {
case "+" -> liczba1 + liczba2;
case "-" -> liczba1 - liczba2;
case "*" -> liczba1 * liczba2;
case "/" -> liczba1 / liczba2;
case "%" -> liczba1 % liczba2;
default -> 0;
};
}
}
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