Java
Core Java programming concepts including strings, collections, exception handling, threading, and reflection.
Questions
Which of the following methods in java is used to extract a single character from a string?
- getChars()
- charAt()
- getBytes()
- toCharArray()
- compareTo()
Which of the following methods in java returns a copy of the invoking string from which any leading and trailing whitespace has been removed?
- replace()
- concat()
- trim()
- substring()
- setLength()
Which of the following methods in java inserts one string into another?
- reverse()
- insert()
- delete()
- append()
- getChars()
Which of the following back end database components provides a database programming interface for java programs?
- ODBC
- JDBC
- JDBC Driver Manager
- replace()
- remove()
Which of the following methods in java applet creates the offscreen image object that will be used for double buffering the display of the menu?
- init()
- update()
- lateinit()
- paint()
- repaint()
Which of the following flags of ImageObserver interface is used to track an image that has been asynchronously stopped before it was complete?
- Width
- Height
- Error
- Abort
- Properties
Which of the following tags in javadoc utility program documents a methods parameter?
- @param
- @return
- @see
- @serial
- @author
Which of the following methods of Font class returns the string equivalent of the invoking font?
- isPlain()
- hashCode()
- isBold()
- isItalic()
- toString()
Which of the following keywords is used in java to refer to any method of the current object?
- width
- height
- this
- static
- implements
The ability of a method to be used in different classes with the same return type and number of arguments is called as _____________.
- methods overloading
- methods overriding
- inheritance
- super
- data encapsulation
Which of the following blocks in exception handling is used to process certain statements irrespective of whether an exception is raised or not?
- try
- catch
- finally
- flush()
- write()
Which of the following methods in java returns the nearest integer value to the argument specified with it?
- min()
- max()
- rint()
- round()
- ceil()
Which of the following methods of Thread class returns a true value if the thread is still active?
- isDaemon()
- isAlive()
- interrupted()
- run()
- setName()
Which of the following methods of Class returns a Class object for each of the public classes and interfaces that are members of the invoking object?
- getClassLoader()
- getClasses()
- forName()
- getConstructors()
- getDeclaredFields()
Which of the following methods of Object class is used to obtain a Class object that describes the invoking object?
- hashCode()
- notify()
- toString()
- getClass()
- equals()