Computer Knowledge

Java Core Classes and Threads

1,935 Questions

Java core classes and threads form the foundation of object oriented programming and are crucial for IT officer and programming exams. This includes concepts like string mutability, collections, and multithreading. Solve these questions to test your practical coding and theoretical knowledge.

String and StringBuffer classesThread execution methodsJava collections frameworkCharacter streams input outputVariable serialization rules

Java Core Classes and Threads Questions

Multiple choice
  1. getConnection(String url, String user, String password)

  2. deregisterDriver(Driver driver)

  3. getLoginTimeout()

  4. registerDriver(Driver driver)

  5. getLog()

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

This is the correct option because there is no method named getLog() in DriverManager class. The correct method is getLogWriter(), which retrieves the log writer.

Multiple choice
  1. isSigned(int param)

  2. isNullable(int param)

  3. getParameterCount()

  4. getParameterName(int param)

  5. getParameterType(int param)

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

This is the correct option because there is no method named getParameterName(int param) in ParameterMetaData interface. The correct method is getParameterTypeName(int param), which retrieves the designated parameter's database-specific type name.

Multiple choice
  1. getParameterName(int param)

  2. getParameterType(int param)

  3. getParameterTypeName(int param)

  4. getParameterNameType(int param)

  5. getTypeOfParameter(int param)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

This is the correct answer because getParameterTypeName(int param) method is defined in ParameterMetaData interface and it retrieves the designated parameter's database-specific type name.

Multiple choice
  1. isWritable(int column)

  2. isReadable(int column)

  3. getColumnsName(int column)

  4. getColumnsCount()

  5. getSchema(int column)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is the correct option because isWritable(int column) is defined in ResultSetMetaData interface and it indicates whether it is possible for a write on the designated column to succeed or not.