Implement a java method that takes as arguments


Problem: Implement a Java method that takes as arguments an array and another value. The method returns the position (index) of the value in the array. For example, given an array {21, 3, 67, -8} and value 3, the routine should return 1 (since 3 occurs at position 1 in the array (what is the first index in a Java array?)). If the value is not found in the array, return -1. Your method should accept generic parameters so that arrays and values of various types can be passed in. Any single method call will pass in a value and an array of the same type. Write your method to be as flexible as possible in other ways as well; e.g. do not hard-code the length of the array that is passed in. This method does not output anything to the screen. From a separate class, call your method from main and demonstrate it working with arrays of at least three different types and sizes. Be sure to demonstrate at least one case where the value is not found in the array. The results of the method calls should be printed to the screen from here.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Implement a java method that takes as arguments
Reference No:- TGS03306377

Expected delivery within 24 Hours