0 votes
in JAVA by
Which of the following creates a List of 3 visible items and multiple selections abled?

i) new List(false, 3)

ii) new List(3, true)

iii) new List(true, 3)

iv) new List(3, false)

1 Answer

0 votes
by

ii) new List(3, true)

Reason: From the above statements, the new List(3, true) is the correct answer; this is because of the constructor type. To create a list of 3 visible items along with the multiple selections abled, we have to use the following constructor of the List class.

List (int rows, boolean multipleMode): It creates a new list initialized to display the described number of rows along with the multiple selection mode.

Therefore, in the statement new List (3, true), three (3) refers to the number of rows and true enables the multiple selections.

...