I’m working on a java question and need an explanation to help me understand better.Write a Java program to do the following task:Create an integer array of size 15. Input the values from user. Input an integer key.
Pass the array and key to a method that searches the key in the array. If the key is found, print the index. Otherwise print that “key is not found” in the method.