java program to print the number of elements in an array.
Answers
Answered by
0
Answer:
public class CountArray {
public static void main(String[] args) {
//Initialize array.
int [] arr = new int [] {1, 2, 3, 4, 5};
//Number of elements present in an array can be found using the length.
System. out. println("Number of elements present in given array: " + arr. length);
}
}
Answered by
0
Explanation: I hope this is helpful for you
Attachments:
Similar questions