Write a method for calculating the sum of odd numbers in the given interval (inclusively) using Stream API.
Important. Use the provided template for your method. Pay attention to type of an argument and the returned value. Please, don't use loops.
Write a method for calculating the sum of odd numbers in the given interval (inclusively) using Stream API.
Important. Use the provided template for your method. Pay attention to type of an argument and the returned value. Please, don't use loops.
Sample Input 1:
0 0Sample Output 1:
0Sample Input 2:
7 9Sample Output 2:
16Sample Input 3:
21 30Sample Output 3:
125Create a free account to access the full topic