Skip to content

Instantly share code, notes, and snippets.

import java.util.Collection
fun IntRange.fizzBuzz() = this.map {
when (#(it % 3, it % 5)) {
is #(0, 0) -> "fizzbuzz"
is #(0, *) -> "fizz"
is #(*, 0) -> "buzz"
else -> ""
}
}
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
public class NewInstanceInConstructor {
public NewInstanceInConstructor() throws Throwable {
// チェック例外を送出する。
throw new IOException();
}
import java.io.IOException;
public class NewInstanceInClass {
public NewInstanceInClass() throws Throwable {
// チェック例外を送出する。
throw new IOException();
}
public static void main(String[] args) {