0

Help with Java Methods

please help and explain if you can, I dont get it: create a method called returnIntFrom that takes two arguments: -an array of ints -An int that represents the index of value to be returned Method should return a single integer in the specific index

29th Mar 2019, 9:45 PM
Albert Yakubov
Albert Yakubov - avatar
3 Answers
29th Mar 2019, 10:49 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
thank you so much guys
29th Mar 2019, 11:05 PM
Albert Yakubov
Albert Yakubov - avatar
0
public static Integer getElement(int[] arr, int index){ return arr!=null && index>=0 && index<arr.length ? arr[index]:null; }
29th Mar 2019, 9:54 PM
Valery Volkov (SPB)
Valery Volkov (SPB) - avatar