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. Java applet

  2. Ajax

  3. Java swing

  4. JSlider

  5. InetAddress class

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

By using Ajax, you can dynamically update the totals on your shopping cart, without forcing the user to click update, and wait for the server to resend the entire page.

Multiple choice
  1. getHeaderNames()

  2. addHeader(java.lang.String name,java.lang.String value)

  3. containsHeader(java.lang.String name)

  4. getHeaders(java.lang.String name)

  5. destroy()

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

If the request did not include any headers of the specified name, this method returns an empty enumeration object.

Multiple choice
  1. to deallocate the applet's resources

  2. automatically after the init()

  3. to initialize an applet

  4. to stop the execution of an applet

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

To deallocate the recources of an applet, destroy() method is called.

Multiple choice
  1. fireContentsChanged(Object src, int ind0, int ind1)

  2. fireIntervalAdded(Object src, int ind0, int ind1)

  3. fireContentsAdded(Object src, int ind0, int ind1)

  4. removeListDataListener(ListDataListener l)

  5. Both 3 and 4

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

This is the correct choice because there is no method fireContentsAdded(Object src, int ind0, int ind1) present in AbstractListModel class in Java.