a) Data structure like queue or stack cannot be implemented b) There are chances of wastage of memory space ...
View QuestionWhat are the advantages of arrays?
a) Objects of mixed data types can be stored b) Elements in an array cannot be sorted c) ...
View QuestionWhich of the following concepts make extensive use of arrays?
a) Binary trees b) Scheduling of processes c) Caching d) Spatial locality Answer: d Explanation: Whenever a particular ...
View QuestionWhen does the ArrayIndexOutOfBoundsException occur?
a) Compile-time b) Run-time c) Not an error d) Not an exception at all Answer: b Explanation: ArrayIndexOutOfBoundsException ...
View Question
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]);
}
}
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]); } }
View Question
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]);
}
}
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]); } }
View QuestionWhich of the following is the correct way to declare a multidimensional array in Java?
a) int[] arr; b) int arr[[]]; c) int[][]arr; d) int[[]] arr; Answer: c Explanation: The syntax to ...
View QuestionHow do you instantiate an array in Java?
a) int arr[] = new int(3); b) int arr[]; c) int arr[] = new int[3];
View QuestionHow do you initialize an array in C?
a) int arr[3] = (1,2,3); b) int arr(3) = {1,2,3}; c) int arr[3] = {1,2,3}; d) int ...
View QuestionWhich of these best describes an array?
a) A data structure that shows a hierarchical behavior b) Container of objects of similar types c) Arrays are immutable once ...
View Question