rgGender.checkedRadioButtonId returns -1 when:

  1. The first button is checked
  2. No radio button in the group is selected
  3. The group is invisible
  4. Both buttons are checked
Answer

B) No radio button in the group is selected

-1 means nothing is checked.

Computer Science MCQ · More Lab: Registration Form UI MCQs · Practise