Print multiple of 3 up to 30 in java 8 using Stream API

Display the multiple of any number in java 8 using stream API, Here is the example of multiple of 3 up to 30 and print them.

IntStream.iterate(1, i->i+1).map(i->i*3).limit(100).forEach(System.out::println);


Output:
3
6
9
12
15
18
21
24
27
30

Happy Coding !!!

1 comment:

  1. You don’t must download any apps end result of|as a end result of} all our beneficial sites are mobile appropriate, and you can entry them from your internet browser. Mr Green's app, which is on the market for Android and iOS, is also be|can be} an choice if 먹튀검증 abc-1111 you prefer to play on your smartphone. The app features intuitive and easy-to-use navigation with tons of features that will guarantee may have} a superb gaming experience. With the app, you can to|you possibly can} wager on your favourite slots, live casino tables, Keno, and sports activities events (live and pre-event). It is safe and straightforward to deposit and withdraw cash from the app, and in case might have|you could have|you may have} any queries, the customer help team is at all times keen to help.

    ReplyDelete