Sample Questions Best site for GRE, LSAT, SAT, GMAT, TOEFL, CCNA, CCSA and interview sample questions  

Technical Sample Questions : C |  C++ |  Oracle |  Java | Unix |  Operating Systems |  Data Structure

Java Sample Questions ›› Java questions

Technical General Java Sample Questions

  1. What is the difference between preemptive scheduling and time slicing?

    Answer: Under preemptive scheduling, the highest priority task executes until it entersthe waiting or dead states or a higher priority task comes into existence.Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks.The scheduler then determines which task should execute next, based on priority and other factors.

  2. When a thread is created and started, what is its initial state?

    Answer: A thread is in the ready state after it has been created and started.

  3. What is the purpose of finalization?

    Answer: The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.

  4. What is the Locale class?

    Answer: The Locale class is used to tailor program output to the conventions of aparticular geographic, political, or cultural region.

  5. What is the difference between a while statement and a do statement?

    Answer: A while statement checks at the beginning of a loop to see whether the nextloop iteration should occur.A do statement checks at the end of a loop to see whether the next iteration of a loop should occur.The do statement will always execute the body of a loop at least once.

  6. What is the difference between static and non-static variables?

    Answer: A static variable is associated with the class as a whole rather than with specific instances of a class.Non-static variables take on unique values with each object instance.

  7. How are this() and super() used with constructors?

    Answer: Othis() is used to invoke a constructor of the same class.super() is used toinvoke a superclass constructor.

  8. What are synchronized methods and synchronized statements?

    Answer: Synchronized methods are methods that are used to control access to an object.A thread only executes a synchronized method after it has acquired the lock for the method's object or class.Synchronized statements are similar to synchronized methods.A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement.

  9. How does Java handle integer overflows and underflows?

    Answer: It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.

  10. Does garbage collection guarantee that a program will not run out of memory?

    Answer: Garbage collection does not guarantee that a program will not run out ofmemory.It is possible for programs to use up memory resources faster than they are garbage collected.It is also possible for programs to create objects that are not subject to garbage collection.

« Previous || Next »

Java Sample Question Number: 1-10| 11-20| 21-30| 31-40| 41-50| 51-60| 61-70| 71-80| 81-90| 91-100| 101-110| 111-120| 121-130| 131-140| 141-150| 151-160| 161-170| 171-180| 181-190| 191-200| 201-210| 211-220| 221-230| 231-240| 241-250| 251-260| 261-270| 271-280| 281-290| 291-300| 301-310| 311-320| 321-330
Sample Test Questions
GRE Sample Questions
CAT Sample Questions
GMAT Sample Questions
TOEFL Sample Questions
ACT Sample Questions
SAT Sample Questions
LSAT Sample Questions
PSAT Sample Questions
MCAT Sample Questions
PMP Sample Questions
GED Sample Questions
ECDL Sample Questions
DMV Sample Questions
CCNA Sample Questions
MCSE Sample Questions
Network+ Sample Questions
A+ Sample Questions
Technical Sample Questions
WASL Sample Questions
CISA Sample Questions

Other Sample Questions
Sample Interview Questions
Sample Teacher Interview Questions
Sample Citizenship Questions
Accuplacer Sample Questions
Science Bowl sample Questions
Driving Test Sample Questions
Sample Survey Questions Sample Essay Questions
Sample Behavioral Interview Questions

Copyright © 2004-2013, Best BSQ. All Rights Reserved.