What will be the output of the following Java program?
import java.util.*;
class Array
{
public static void main(String args[])
{
int array[] = new int [5];
for (int i = 5; i > 0; i--)
array[5-i] = i;
Arrays.fill(array, 1, 4, 8);
for (int i = 0; i < 5 ; i++)
System.out.print(array[i]);
}
}
import java.util.*;
class Array
{
public static void main(String args[])
{
int array[] = new int [5];
for (int i = 5; i > 0; i--)
array[5-i] = i;
Arrays.fill(array, 1, 4, 8);
for (int i = 0; i < 5 ; i++)
System.out.print(array[i]);
}
}A. 12885
B. 12845
C. 58881
D. 54881
Answer: Option C
What is the purpose of the Java Collections Framework?
A. To provide a unified architecture for representing and manipulating collections
B. To provide a way to create arrays
C. To define primitive data types
D. To handle exceptions
A. `Collection`
B. `Map`
C. `Set`
D. `List`
What is the primary difference between a `List` and a `Set` in the Java Collections Framework?
A. A `Set` allows duplicate elements, while a `List` does not
B. A `List` is unmodifiable, while a `Set` is modifiable
C. A `List` allows duplicate elements, while a `Set` does not
D. A `Set` is indexed, while a `List` is not
Which class is typically used to implement a `List` in the Java Collections Framework?
A. `HashMap`
B. `ArrayList`
C. `LinkedList`
D. None of These

Join The Discussion