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. 10

  2. 9

  3. 8

  4. 7

  5. 6

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

There are 8 constructors of SQLTimeoutException class in java. These are:- 1) SQLTimeoutException():- Constructs a SQLTimeoutException object 2) SQLTimeoutException(String reason):- Constructs a SQLTimeoutException object with a given reason 3) SQLTimeoutException(String reason, String SQLState):- Constructs a SQLTimeoutException object with a given reason and SQLState 4) SQLTimeoutException(String reason, String SQLState, int vendorCode):- Constructs a SQLTimeoutException object with a given reason, SQLState and vendorCode 5) SQLTimeoutException(String reason, String SQLState, int vendorCode, Throwable cause):- Constructs a SQLTimeoutException object with a given reason, SQLState, vendorCode and cause 6) SQLTimeoutException(String reason, String SQLState, Throwable cause):- Constructs a SQLTimeoutException object with a given reason, SQLState and cause 7) SQLTimeoutException(String reason, Throwable cause):- Constructs a SQLTimeoutException object with a given reason and cause 8) SQLTimeoutException(Throwable cause):- Constructs a SQLTimeoutException object with a given cause So, this is the correct answer.

Multiple choice
  1. These variable are used to save an object into a file.

  2. The thread will read the most recent updated value by using volatile variable.

  3. It is used to create variables and methods that will exist independently of any instances created for the class.

  4. Volatile variables are used in asynchronous medium.

  5. Both (2) and (4)

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

.