For this Question: Write a function called oddball_sum which takes in a list of numbers and returns the sum of all the odd elements.
Try to solve with and without reduce function.An array containing numbersSum of all the odd numbers in that arraySample Input:-
1 3 5 4

Sample output:-
9

Explanation-
1+3+5=9, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static int odd_ball( ArrayList<Integer> myNumbers){
        int res=0;
         for (int i : myNumbers){
             if(i%2!=0){
                 res+=i;
             }
         }
         return res;
    }
    public static void main (String[] args) {
        Scanner sc= new Scanner(System.in);
        ArrayList<Integer> myNumbers = new ArrayList<Integer>();
   while (sc.hasNextInt()) {
    int i = sc.nextInt();
     myNumbers.add(i);
}


System.out.print( odd_ball(myNumbers));







    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?