Java

Core Java programming concepts including strings, collections, exception handling, threading, and reflection.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following methods in java is used to extract a single character from a string?

  1. getChars()
  2. charAt()
  3. getBytes()
  4. toCharArray()
  5. compareTo()
Question 2 Multiple Choice (Single Answer)

Which of the following methods in java returns a copy of the invoking string from which any leading and trailing whitespace has been removed?

  1. replace()
  2. concat()
  3. trim()
  4. substring()
  5. setLength()
Question 3 Multiple Choice (Single Answer)

Which of the following methods in java inserts one string into another?

  1. reverse()
  2. insert()
  3. delete()
  4. append()
  5. getChars()
Question 4 Multiple Choice (Single Answer)

Which of the following back end database components provides a database programming interface for java programs?

  1. ODBC
  2. JDBC
  3. JDBC Driver Manager
  4. replace()
  5. remove()
Question 5 Multiple Choice (Single Answer)

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?

  1. init()
  2. update()
  3. lateinit()
  4. paint()
  5. repaint()
Question 6 Multiple Choice (Single Answer)

Which of the following flags of ImageObserver interface is used to track an image that has been asynchronously stopped before it was complete?

  1. Width
  2. Height
  3. Error
  4. Abort
  5. Properties
Question 7 Multiple Choice (Single Answer)

Which of the following tags in javadoc utility program documents a methods parameter?

  1. @param
  2. @return
  3. @see
  4. @serial
  5. @author
Question 8 Multiple Choice (Single Answer)

Which of the following methods of Font class returns the string equivalent of the invoking font?

  1. isPlain()
  2. hashCode()
  3. isBold()
  4. isItalic()
  5. toString()
Question 9 Multiple Choice (Single Answer)

Which of the following keywords is used in java to refer to any method of the current object?

  1. width
  2. height
  3. this
  4. static
  5. implements
Question 10 Multiple Choice (Single Answer)

The ability of a method to be used in different classes with the same return type and number of arguments is called as _____________.

  1. methods overloading
  2. methods overriding
  3. inheritance
  4. super
  5. data encapsulation
Question 11 Multiple Choice (Single Answer)

Which of the following blocks in exception handling is used to process certain statements irrespective of whether an exception is raised or not?

  1. try
  2. catch
  3. finally
  4. flush()
  5. write()
Question 12 Multiple Choice (Single Answer)

Which of the following methods in java returns the nearest integer value to the argument specified with it?

  1. min()
  2. max()
  3. rint()
  4. round()
  5. ceil()
Question 13 Multiple Choice (Single Answer)

Which of the following methods of Thread class returns a true value if the thread is still active?

  1. isDaemon()
  2. isAlive()
  3. interrupted()
  4. run()
  5. setName()
Question 14 Multiple Choice (Single Answer)

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?

  1. getClassLoader()
  2. getClasses()
  3. forName()
  4. getConstructors()
  5. getDeclaredFields()
Question 15 Multiple Choice (Single Answer)

Which of the following methods of Object class is used to obtain a Class object that describes the invoking object?

  1. hashCode()
  2. notify()
  3. toString()
  4. getClass()
  5. equals()