java Methods | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

java Methods

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

2nd Apr 2019, 11:37 PM
Albert Yakubov
Albert Yakubov - avatar
1 Answer
+ 2
class with main() ... declare int[] array and assign some {values} System.out.println ( call your method (array, 2) ) with static metod returnIntFrom( with two parameters int[] array and int index ) return value from array at [index] position // add class and metod syntax {} and ;;;; and int as method return type
3rd Apr 2019, 12:08 AM
zemiak