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. Min(c : collection)

  2. Shuffle(list)

  3. Frequency(c : collection, o : object)

  4. Copy(destination, source)

  5. Merge(c : collection, c1 : collection)

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

This is the correct answer because there is no method named Merge(c : collection, c1 : collection) in Collections class.  

Multiple choice
  1. putAll(map : m)

  2. Get(key : K)

  3. isEmpty()

  4. removeLast()

  5. put(Key : K, Value : V)

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

This is the correct choice because removeLast() method is not present in the Map interface. It is present in LinkedList class. This method removes the last element from the list.

Multiple choice
  1. containsKey(object)

  2. containsValue(object)

  3. Get(key : K)

  4. Put(key : K, Value : V)

  5. setValue(Value : V)

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

This is the correct choice because setValue(Value : V) method is not present in the Map interface. This method is present in the Entry interface. This method replaces the value in this entry with a new specified value.