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. setVGap(int gap)

  2. setVGroup(GroupLayout.Group group)

  3. getLayoutAlignmentY(Container parent)

  4. minLayoutSize(Container parent)

  5. layoutSize(Container parent)

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

This is the correct choice. getLayoutAlignmentY(Container parent) method is present in the GroupLayout class. This method returns the alignment along the y-axis.

Multiple choice
  1. Static block is always executed when the JVM loads the class in java.

  2. Static method can be synchronized in java.

  3. We can throw exception in a static block.

  4. All of the above are true.

  5. Only (1) and (3) are true.

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

Yes, all of the above are the true statement in java.