Multiple choice

Which of the following methods is used to return the index of a specified component in JMenuBar class?

  1. getIndexOf(Component c)

  2. getComponentIndex(Component c)

  3. getIndex(Component c)

  4. getIndexOfComponent(Component c)

  5. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

getcomponentIndex(Component c) method is present in JMenuBar class.