Java Methods (GATE - CS)
Identify methods present in various Java classes and interfaces including collections, I/O, Swing, and JDBC APIs.
Questions
Which of the following methods is/are present in the ArrayList class in Java?
- sort(int[] a)
- indexOf(Object o)
- copyOfRange(double[] orr, int fr, int t)
- Both 1 and 2
- Both 2 and 3
Which of the following methods is/are present in ConcurrentSkipListMap class in Java?
- ceilingKey(K key)
- remove(KeyStroke key)
- ceilingEntry(K key)
- Both 1 and 2
- Both 1 and 3
Which of the following methods is/are present in the Files class in Java?
- readAllBytes(Path p)
- isHidden(Path p)
- isSame(Path p1, Path p2)
- size(Path p)
- isSymbolicLink(Path p)
Which of the following methods is/are not present in the AbstractListModel class in Java?
- fireContentsChanged(Object src, int ind0, int ind1)
- fireIntervalAdded(Object src, int ind0, int ind1)
- fireContentsAdded(Object src, int ind0, int ind1)
- removeListDataListener(ListDataListener l)
- Both 3 and 4
Which of the following methods is/are present in the JMenu class in Java?
- addComponent(Component c, int index)
- add(Component c, int index)
- add(int index, Component c)
- addComponent(int index, Component c)
- addcomponent(Component c)
Which of the following methods is/are not present in the ActionEvent class in Java?
- getWhen()
- getActionCommand()
- actionPerformed(ActionEvent e)
- paramString()
- getModifiers()
Which of the following methods is/are not present in the Button class in Java?
- processEvent(Event e)
- getActionCommand()
- setLable(String txt)
- setActionCommand(String cmd)
- getAccessibleContext()
Which of the following methods is/are present in the Integer class in Java?
- isEqual(int x , int y )
- compareTo(Integer x)
- compare(int x, int y)
- Both 2 and 3
- 1, 2 and 3
Which of the following methods is used to return the index of a specified component in JMenuBar class?
- getIndexOf(Component c)
- getComponentIndex(Component c)
- getIndex(Component c)
- getIndexOfComponent(Component c)
- None of these
Which of the following methods is/are not present in the SQLData interface?
- getSQLTypeName()
- writeSQL(SQLOutput str)
- readSQL(SQLInput stream, String type)
- getSQLState()
- None of these
Which of the following methods is present in the ResultSet interface in Java?
- wasNull()
- getTableName(int column)
- isCaseSensitive(int column)
- getColumnType(int column)
- getColumnName(int column)
Which of the following methods in DatabaseMetaData interface retrieves a list of the time and date functions available with this database?
- getDateAndTimeFunctions()
- getTimeAndDateFunctions()
- getDateTimeFunctions()
- getTimeDateFunctions()
- getAllTimeDateFunctions()
Which of the following methods retrieves the maximum number of columns that a database allows in a GROUP BY clause?
- getMaxColumnsInGroupBy()
- getMaxColsInGroupBy()
- getMaxColumnInGroupBy()
- getMaxGroupByColumns()
- getMaxColumnsAllowedInGroupBy()
Which of the following methods is not present in the Statement interface in Java?
- getWarnings()
- getResultSet()
- getStatement()
- getResultSetType()
- isClosed()
Which of the following methods is not present in the ResultSetMetaData interface in Java?
- isWritable(int column)
- isSearchable(int column)
- isNullable(int column)
- isAutoIncrement(int column)
- isClosed()