Computer Knowledge

Java Core Classes and Threads

1,473 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. If exception then exception handling statements

  2. If raised_exception then exception handling statements

  3. When exception then exception handling statements

  4. When raised_exception then exception handling statements

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

Exception handling prevents the program from abnormal termination. If a program encounters an exception/run time error, the control moves to the exception part where it is handled using the 'when exception then' keyword. For example: To handle a user defined exception, the statement will be  when no_data_found then dbms_output.put_line('No Records Found');

Multiple choice
  1. getDateAndTimeFunctions()

  2. getTimeAndDateFunctions()

  3. getDateTimeFunctions()

  4. getTimeDateFunctions()

  5. getAllTimeDateFunctions()

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

This is the correct choice. DatabaseMetaData interface in Java contains a method called getTimeDateFunctions() and it retrieves a comma-separated list of time and date functions available with this database.