Answers for "get value of array java"

0

how to get a section of an array in java

//index   0   1   2   3   4
int[] arr = {10, 20, 30, 40, 50};
Arrays.copyOfRange(arr, 0, 2);          // returns {10, 20}
Arrays.copyOfRange(arr, 1, 4);          // returns {20, 30, 40}
Arrays.copyOfRange(arr, 2, arr.length); // returns {30, 40, 50} (length = 5)
Posted by: Guest on March-22-2021
0

get array element java

array_name[position]
Posted by: Guest on April-19-2021

Code answers related to "get value of array java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language