Answer to Question #285872 in Java | JSP | JSF for Daniel

Question #285872

What is the output of the following Java program?

import java.util.*;

class ArrayGames {

public static void main(String[] args) {

int[] a = {1,2,3,4,5};

System.out.println(a[1]);

}

}


1
Expert's answer
2022-01-09T02:21:35-0500
This program will display the second element of the array at index 1:
2

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog