Is this a "one liner" in Java?
FuzzBuzzCounter.java
public static void main(String[] args) {
LongStream.rangeClosed(1, Long.parseLong(args[0])).forEach(i -> System.out.println(((i % 3) == 0 ? "Fizz" + ((i % 5) == 0 ? "Buzz" : "") : ((i % 5) == 0 ? "Buzz" : i))));
}
Recommended Posts