-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrun_kotlin.http
14 lines (13 loc) · 958 Bytes
/
run_kotlin.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
### Kotlin 2.1.10
POST {{url}}/run
Content-Type: application/json
{
"templateId": "kotlin_2_1_10",
"files": {
"Main.kt": "abstract class Person(val name: String) {\n abstract fun greet()\n}\n\ninterface FoodConsumer {\n fun eat()\n fun pay(amount: Int) = println(\"Delicious! Here's $amount bucks!\")\n}\n\nclass RestaurantCustomer(name: String, val dish: String) : Person(name), FoodConsumer {\n fun order() = println(\"$dish, please!\")\n override fun eat() = println(\"*Eats $dish*\")\n override fun greet() = println(\"It's me, $name.\")\n}\n\nfun main() {\n val sam = RestaurantCustomer(\"Sam\", \"Mixed salad\")\n sam.greet() // An implementation of an abstract function\n sam.order() // A member function\n sam.eat() // An implementation of an interface function\n sam.pay(10) // A default implementation in an interface\n}\n"
},
"args": "--name Mark",
"stdin": "100.00",
"externalOptions": {
}
}