Java MCQ: What is a Vector in Java?
a) A synchronized, dynamic array
b) A type of linked list
c) An unsynchronized array
d) A set that does not allow duplicates
Answer:
a) A synchronized, dynamic array
Explanation:
A Vector
in Java is a synchronized, dynamic array that can grow as needed. It allows elements to be added or removed, and provides methods for accessing elements by index.
Understanding vectors is important for working with thread-safe collections that require dynamic resizing.
Reference links:
https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html