praktikum1/aufgabe1
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package org.example.demo.praktikum1.aufgabe1;
|
||||
import jakarta.ejb.Stateless;
|
||||
|
||||
@Stateless
|
||||
public class Calculator implements CalculatorRemote {
|
||||
public double addiere(float zahl1, float zahl2) {
|
||||
return zahl1 + zahl2;
|
||||
}
|
||||
public double subtrahiere(float zahl1, float zahl2) {
|
||||
return zahl1 - zahl2;
|
||||
}
|
||||
public double multipliziere(float zahl1, float zahl2) {
|
||||
return zahl1 * zahl2;
|
||||
}
|
||||
public double dividiere(float zahl1, float zahl2) {
|
||||
// todo: division by 0 exception?
|
||||
return zahl1 / zahl2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.example.demo.praktikum1.aufgabe1;
|
||||
import jakarta.ejb.Remote;
|
||||
|
||||
@Remote
|
||||
public interface CalculatorRemote {
|
||||
double addiere(float zahl1, float zahl2);
|
||||
double subtrahiere(float zahl1, float zahl2);
|
||||
double multipliziere(float zahl1, float zahl2);
|
||||
double dividiere(float zahl1, float zahl2);
|
||||
}
|
||||
Reference in New Issue
Block a user