Please write in Java and Array list.
3 THE COUNT LIKE PROBLEM
Start with 1 String array wordList and one String word. Yourmethod should calculate and return the number of times that wordappears in the array wordList.
countLike({“a”, “a”, “b”, “c”}, “a”) → 2
countLike({“a”, “a”, “b”, “c”}, “c”) → 1
countLike({“a”, “a”, “b”, “c”}, “3”) → 0
4 THE AVERAGE EVENS PROBLEM
Start with an int array named nums. Return the average of allthe even numbers in the array. A number (n) is even if n % 2 == 0.If there are no even numbers in the array, return -1.
averageEvens({1, 2, 3}) → 2.0
averageEvens({1, 5}) →
OR
OR