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. String class

  2. Char class

  3. Math class

  4. String buffer class

  5. None of the above

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

The Char class is a wrapper class, which provides following methods: toUpperCase(),toLowerCase(),isLetter(),isSpace(),isDigit()

Multiple choice
  1. Both == and equals() check whether two objects belong to the same instance.

  2. == compares characters inside a string object, while equals() check whether two objects belong to the same instance.

  3. Both == and equals() compare characters inside the string object.

  4. == operator checks whether two objects belong to the same instance, while equals() compares characters inside the string object.

  5. None of the above

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

This is the correct answer as == operator checks whether two objects belong to the same instance, while equals() compares characters inside the string object.

Multiple choice
  1. Only (a)

  2. Only (a) , (b), (c)

  3. Only (a) and (b)

  4. All (a), (b), (c), (d) are built in exceptions.

  5. None of the above

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

The IOException get raised whenever an input output task is attempted by user using standard I/O device.So all a,b,c,d are Built in Exception in Java.