Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Java FizzBuzz
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
IntStream.range(1, 100).boxed()
.map(n -> n % 15 == 0 ? "FizzBuzz"
: n % 5 == 0 ? "Buzz"
: n % 3 == 0 ? "Fizz"
: n)
.forEach(System.out::println);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment