Kotlin vs Java

Read file contents into a string
Java
String content = null;
try {
    content = Files.readString(filePath);
} catch (IOException e) {
    e.printStackTrace();
}
Kotlin
File("doc.txt").readText()