English, asked by summerkhiangte3929, 5 hours ago

Predict the output public static void main(String[] args) { int[] arr, arr = new int[5]; arr[4]=40; System.out.println(arr[2]) System.out.println(""+arr[4]:

Answers

Answered by theresamary4866
12

Answer:

0 40

Explanation:

Answered by Khanreema
0

Answer:

the output of this signal is:

0

40

Explanation:

In Java, an array is an object that holds components of the same data type. Furthermore, the elements of an array are held at a single memory address. It is a data structure where we save comparable objects; nevertheless, a Java array can only carry a limited number of items.

The Java code provided is,

SumOfArray is a public class.

main(String[] args) int[] arr-new int[11.2.3.4]; public static void main(String[] args) int[] arr-new int[11.2.3.4

int sum = 0;

(int i=0arr length:++) for

{|||||

sum=sum+arl}}}

System.out.println("Sum of all RTY elements"-sum)

#SPJ3

Similar questions