1 Crore+ students have signed up on EduRev. Have you? Download the App |
What is the output of the following Java code?
public class array
{
public static void main(String args[])
{
int []arr = {1,2,3,4,5};
System.out.println(arr[2]);
System.out.println(arr[4]);
}
}
Which of the following is the correct way to declare a multidimensional array in Java?
What is the output of the following Java code?
public class array
{
public static void main(String args[])
{
int []arr = {1,2,3,4,5};
System.out.println(arr[5]);
}
}
55 docs|215 tests
|
55 docs|215 tests
|