Java Methods (GATE - CS)

Methods in Java Classes

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following methods is present in the AbstractButton class in Java?

  1. getIconGap()
  2. getTextGap()
  3. getTextIconGap()
  4. getIconTextGap()
  5. None of these
Question 2 Multiple Choice (Single Answer)

Which of the following methods is not present in the AbstractButton class in Java?

  1. getDisabledIcon()
  2. getDisabledSelectedIcon()
  3. getSelectedDisabledIcon()
  4. getHorizontalAlignment()
  5. getHorizontalTextPosition()
Question 3 Multiple Choice (Single Answer)

Which of the following methods is not present in the AtomicInteger class in Java?

  1. addAndGet(int x)
  2. getAndSet(int Value)
  3. incrementAndGet()
  4. doubleValue()
  5. isInteger(int x)
Question 4 Multiple Choice (Single Answer)

Which of the following methods is not defined in the WindowEvent class in Java?

  1. getWindow()
  2. getOppositeWindow()
  3. getNewState()
  4. windowLostFocus(WindowEvent e)
  5. None of these
Question 5 Multiple Choice (Single Answer)

Which of the following methods is present in the CardLayout class in Java?

  1. removeLayoutComponent(Component c)
  2. removeComponent(Component c)
  3. maxLayoutSize(Container c)
  4. preferredSize(Container c)
  5. addLayoutComponent(Component c, Object constraints)
Question 6 Multiple Choice (Single Answer)

Which of the following methods in BlockView class determines the maximum span for a view along an axis?

  1. getMaximumSpanAxis(int axis)
  2. getMaxSpanAxis(int axis)
  3. getMaximumSpan(int axis)
  4. getMaxSpanAxis(int axis)
  5. None of these
Question 7 Multiple Choice (Single Answer)

Which of the following methods is not present in the Book class in Java?

  1. append(Printable painter, PageFormat page)
  2. getNumberOfPages()
  3. getPageFormat(int pageIndex)
  4. setPage(int pageIndex, Printable painter, PageFormat page)
  5. readPage(int PageIndex)
Question 8 Multiple Choice (Single Answer)

Which of the following methods in CardLayout class determines the minimum size for a specified panel?

  1. minimumSize(Container p)
  2. minLayoutSize(Container p)
  3. minimumLayoutSize(Container p)
  4. layoutMinSize(Container p)
  5. layoutMinimumSize(Container p)
Question 9 Multiple Choice (Single Answer)

Which of the following methods is not present in the Buffer class in Java?

  1. isReadOnly()
  2. limit()
  3. limit(int x)
  4. isWriteOnly()
  5. position()
Question 10 Multiple Choice (Single Answer)

Which of the following methods is not present in the Choice class in Java?

  1. getItemAtIndex(int index)
  2. getItem(int index)
  3. getSelectedIndex()
  4. getItemCount()
  5. getSelectedItem()
Question 11 Multiple Choice (Single Answer)

Which of the following methods in AbstractLayoutCache class returns the number of visible children for a row?

  1. getChildCount(TreePath path)
  2. getVisibleChildrenCount(TreePath path)
  3. getVisibleChildCount(TreePath path)
  4. getChildrenCount(TreePath path)
  5. getAllChildCount(TreePath path)
Question 12 Multiple Choice (Single Answer)

Which of the following methods is not present in the AbstractLayoutCache class in Java?

  1. isRootVisible()
  2. isRowHeightFixed()
  3. isExpanded(TreePath path)
  4. getRowCount()
  5. getRowHeight()
Question 13 Multiple Choice (Single Answer)

Which of the following methods is not present in the Container class in Java?

  1. getComponents()
  2. getCount()
  3. getComponentAt(Point p)
  4. getComponentAt(int x, int y)
  5. getComponent(int n)
Question 14 Multiple Choice (Single Answer)

Which of the following methods in BigInteger class returns the first integer that is prime?

  1. nextProbablePrimeNumber()
  2. nextProbablePrime()
  3. nextPrime()
  4. nextPrimeNumber()
  5. nextProbablePrimeInteger()
Question 15 Multiple Choice (Single Answer)

Which of the following methods is present in the Container class in Java?

  1. geCount()
  2. getMaxSize()
  3. getLayout()
  4. isVisible()
  5. getAllComponents()