Java Methods (GATE - CS)

Identify methods present in various Java classes and interfaces including collections, I/O, Swing, and JDBC APIs.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following methods is/are present in the ArrayList class in Java?

  1. sort(int[] a)
  2. indexOf(Object o)
  3. copyOfRange(double[] orr, int fr, int t)
  4. Both 1 and 2
  5. Both 2 and 3
Question 2 Multiple Choice (Single Answer)

Which of the following methods is/are present in ConcurrentSkipListMap class in Java?

  1. ceilingKey(K key)
  2. remove(KeyStroke key)
  3. ceilingEntry(K key)
  4. Both 1 and 2
  5. Both 1 and 3
Question 3 Multiple Choice (Single Answer)

Which of the following methods is/are present in the Files class in Java?

  1. readAllBytes(Path p)
  2. isHidden(Path p)
  3. isSame(Path p1, Path p2)
  4. size(Path p)
  5. isSymbolicLink(Path p)
Question 4 Multiple Choice (Single Answer)

Which of the following methods is/are not present in the AbstractListModel class in Java?

  1. fireContentsChanged(Object src, int ind0, int ind1)
  2. fireIntervalAdded(Object src, int ind0, int ind1)
  3. fireContentsAdded(Object src, int ind0, int ind1)
  4. removeListDataListener(ListDataListener l)
  5. Both 3 and 4
Question 5 Multiple Choice (Single Answer)

Which of the following methods is/are present in the JMenu class in Java?

  1. addComponent(Component c, int index)
  2. add(Component c, int index)
  3. add(int index, Component c)
  4. addComponent(int index, Component c)
  5. addcomponent(Component c)
Question 6 Multiple Choice (Single Answer)

Which of the following methods is/are not present in the ActionEvent class in Java?

  1. getWhen()
  2. getActionCommand()
  3. actionPerformed(ActionEvent e)
  4. paramString()
  5. getModifiers()
Question 7 Multiple Choice (Single Answer)

Which of the following methods is/are not present in the Button class in Java?

  1. processEvent(Event e)
  2. getActionCommand()
  3. setLable(String txt)
  4. setActionCommand(String cmd)
  5. getAccessibleContext()
Question 8 Multiple Choice (Single Answer)

Which of the following methods is/are present in the Integer class in Java?

  1. isEqual(int x , int y )
  2. compareTo(Integer x)
  3. compare(int x, int y)
  4. Both 2 and 3
  5. 1, 2 and 3
Question 9 Multiple Choice (Single Answer)

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
Question 10 Multiple Choice (Single Answer)

Which of the following methods is/are not present in the SQLData interface?

  1. getSQLTypeName()
  2. writeSQL(SQLOutput str)
  3. readSQL(SQLInput stream, String type)
  4. getSQLState()
  5. None of these
Question 11 Multiple Choice (Single Answer)

Which of the following methods is present in the ResultSet interface in Java?

  1. wasNull()
  2. getTableName(int column)
  3. isCaseSensitive(int column)
  4. getColumnType(int column)
  5. getColumnName(int column)
Question 12 Multiple Choice (Single Answer)

Which of the following methods in DatabaseMetaData interface retrieves a list of the time and date functions available with this database?

  1. getDateAndTimeFunctions()
  2. getTimeAndDateFunctions()
  3. getDateTimeFunctions()
  4. getTimeDateFunctions()
  5. getAllTimeDateFunctions()
Question 13 Multiple Choice (Single Answer)

Which of the following methods retrieves the maximum number of columns that a database allows in a GROUP BY clause?

  1. getMaxColumnsInGroupBy()
  2. getMaxColsInGroupBy()
  3. getMaxColumnInGroupBy()
  4. getMaxGroupByColumns()
  5. getMaxColumnsAllowedInGroupBy()
Question 14 Multiple Choice (Single Answer)

Which of the following methods is not present in the Statement interface in Java?

  1. getWarnings()
  2. getResultSet()
  3. getStatement()
  4. getResultSetType()
  5. isClosed()
Question 15 Multiple Choice (Single Answer)

Which of the following methods is not present in the ResultSetMetaData interface in Java?

  1. isWritable(int column)
  2. isSearchable(int column)
  3. isNullable(int column)
  4. isAutoIncrement(int column)
  5. isClosed()