This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kz.technodom.merchant.service | |
import java.lang.StringBuilder | |
fun Int.abs() : Int = if (this < 0) -this else this | |
fun List<String>.midElement() : String { | |
if (this.isEmpty()){ | |
throw NoSuchElementException("List is empty") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kz.technodom.merchant.service | |
//Simple hello world | |
fun main() { | |
println("Hello, World") | |
printMessage("Hello!") | |
printMessageWithPrefix("Hello", "Toxa") | |
printMessageWithPrefix("Hello2" ) | |
multiply(2,3) |