17 lines
369 B
Kotlin
17 lines
369 B
Kotlin
package drills.drill01.exercise1
|
|
|
|
import java.rmi.Remote
|
|
import java.rmi.RemoteException
|
|
import java.rmi.server.UnicastRemoteObject
|
|
|
|
interface Adder : Remote {
|
|
@Throws(RemoteException::class)
|
|
fun add(a: Int, b: Int): Long?
|
|
}
|
|
|
|
class AdderImpl : Adder, UnicastRemoteObject() {
|
|
override fun add(a: Int, b: Int): Long? {
|
|
return (a + b).toLong()
|
|
}
|
|
}
|