i ran your code and yes the checkbox 3 and 4 were selected. so your answer is right.
BUT i just could not understand this line
CheckboxGroup[] cbgs = new CheckboxGroup[] { new CheckboxGroup(), new CheckboxGroup()};
can someone explain this line ?
the array cbgs[] has how many memebers ? each is an object of class CheckboxGroup.
Originally posted by sonir shah:
Which checkboxes will initially be selected when the following program is run?
Options :
1)All Checkboxes
2)None of the Checkboxes
3)It will throw Runtime Exception
4)The checkbox labeled Checkbox0 and Checkbox2
5)The checkbox labeled Checkbox3 and Checkbox4
Answer : 5)
I just want to check that the answer is 5) ONLY because of the statement cbgs[i%2] where 2 refers to the last two checkboxes.
Am I right?
Sonir