import java.awt.*;
public class TestClass extends Frame
{
TestClass( )
{
setLayout(new FlowLayout());
CheckboxGroup[] cbgs = new CheckboxGroup[] { new CheckboxGroup(), new CheckboxGroup()};
for (int i=0; i<5; i++) add( new Checkbox("Checkbox"+i, true, cbgs[i%2] ) );
setSize(300, 300);
setVisible(true);
}
public static void main(
String[ ] args)
{
new TestClass();
}
}
1)All CheckBoxes
2)None of the CheckBoxes
3)It will throw RunTimeException
4)The checkboxes labeled Checkbox0,Checkbox2
5)The checkboxes labeled CheckBox3 and CheckBox4
Ans : 5)
According to me it should display the checkBox labeled 4(i.e last one)
Can any one explain me the question and the answer?