🎴 Flashcard Mode
Java Collections and Strings
Card1 / 15
Mastered0
Review0
QuestionClick to flip
How many constructors are there of ArrayList class in Java?
AnswerClick to flip back
A
3
💡 Explanation:
This is the correct answer as there are 3 constructors of ArrayList class in Java Collections, viz. ArrayList(): creates an empty constructor with default initial capacity; ArrayList(c : collection): creates an arraylist from existing collection c; and ArrayList(x int): creates an arraylist with initial capacity x. So, this is the correct answer.