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 technology
    • (void)webViewDidStartLoad:(UIWebView *)webView;
    • (void)webViewDidFinishLoad:(UIWebView *)webView;
    • (void)webView:(UIWebView *)webViewdidFailLoadWithError:(NSError *)error;
  1. None

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

The UIWebViewDelegate protocol's webViewDidStartLoad: is the first method called when a web view begins loading content. This is followed by either webViewDidFinishLoad: or webView:didFailLoadWithError: depending on the outcome. Option D (None) is incorrect since the delegate protocol defines specific lifecycle methods.

Multiple choice java
  1. System.arraycopy(fromarray,frominden,toarray,toindex,count);

  2. System.arraycopy(toarray,toinden,fromarray,fromindex,count);

  3. System.arraycopy(fromarray,toarray,count);

  4. System.arraycopy();

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

System.arraycopy copies array elements from source to destination. The correct syntax requires: source array, starting position in source, destination array, starting position in destination, and number of elements to copy. Option A correctly shows this parameter order.

Multiple choice technology programming languages
  1. Used for Cloning or copying integer var

  2. Used for Cloning or copying float var

  3. Used for Cloning or copying String var

  4. Used for Cloning an array

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

The clone() method in Java is commonly used for creating copies of arrays. While arrays can also be cloned using other methods, the clone() method provides a straightforward way to duplicate array contents.

Multiple choice technology packaged enterprise solutions
  1. doInit(),doPageAction(),doUpdate()

  2. init(),service(),destroy()

  3. doInit(),doPageAction(),destroy()

  4. init(),service(),doUpdate()

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

The PSFramework ActionController uses doInit(), doPageAction(), and doUpdate() as its primary action methods. This naming convention follows the framework's pattern where doInit handles initialization, doPageAction processes page submissions, and doUpdate handles data updates. Option B uses generic servlet lifecycle methods, C mixes destroy instead of doUpdate, and D doesn't follow the framework's do- prefix convention.

Multiple choice technology programming languages
  1. Response.Output.Write() allows you to flush output

  2. Response.Output.Write() allows you to buffer output

  3. Response.Output.Write() allows you to write formatted output

  4. Response.Output.Write() allows you to stream output

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

Response.Output.Write() provides formatted output capabilities similar to String.Format, allowing you to write formatted strings with placeholders. Response.Write() only writes raw strings without formatting support. Options about flushing, buffering, or streaming are incorrect - both methods ultimately write to the same response stream.

Multiple choice technology web technology
  1. while loading the hide effect

  2. before the hide effect completed

  3. after the hide effect completed

  4. none

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

In jQuery effects, callback functions are executed AFTER the effect animation completes. This ensures sequential execution of code, allowing you to perform actions only after the visual effect has finished. The callback does not run during or before the effect, but specifically after the animation completes.

Multiple choice technology web technology
  1. calc()

  2. height()

  3. average()

  4. max()

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

The jQuery height() method is used to get or set the height of elements. Options A (calc), C (average), and D (max) are not valid jQuery methods - calc() is a CSS function, while average() and max() are not standard jQuery methods for size manipulation.

Multiple choice technology packaged enterprise solutions
  1. previous

  2. next

  3. default

  4. NULL

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

FieldDefault PeopleCode fires when a page is first displayed, allowing you to programmatically set initial default values for fields. This is different from FieldFormula or FieldChange events - FieldDefault only runs once at initial display, not during row insert or subsequent field edits.

Multiple choice technology platforms and products
  1. ContentResolver.query(), Activity.managedQuery()

  2. Activity.query(), ContentResolver.managedQuery()

  3. ContentResolver.makeQuery(), Activity.managedQuery()

  4. None of above

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

Both ContentResolver.query() and Activity.managedQuery() return a Cursor object and accept the same parameters (URI, projection, selection, selectionArgs, sortOrder). managedQuery() is deprecated but was commonly used in older Android code.

Multiple choice technology platforms and products
  1. Query()

  2. Update()

  3. Create()

  4. Insert()

  5. a, b and c above

  6. a, b and d above

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

The ContentProvider abstract class requires implementing: onCreate(), query(), insert(), update(), delete(), and getType(). The statement's options are slightly mixed - 'Create()' is not the exact method name (it's onCreate()), but the key CRUD methods (query, update, insert) are correct abstract methods. Option F correctly identifies query(), update(), and insert() as abstract methods.