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 ›› Core Java Sample Questions

Technical Sample Questions : Java Sample Questions : Core Java Sample Questions

  1. What's the difference between a queue and a stack?

    Answer: Stacks works by last-in-first-out rule (LIFO), while queues use the FIFO rule

  2. You can create an abstract class that contains only abstract methods.On the other hand, you can create an interface that declares the same methods.So can you use abstract classes instead of interfaces?

    Answer: Sometimes.But your class may be a descendent of another class and in this case the interface is your only option.

  3. What comes to mind when you hear about a young generation in Java?

    Answer: Garbage collection.

  4. What comes to mind when someone mentions a shallow copy in Java?

    Answer: Object cloning.

  5. If you're overriding the method equals() of an object, which other method you might also consider?

    Answer: hashCode()

  6. You are planning to do an indexed search in a list of objects.Which of the two Java collections should you use: ArrayList or LinkedList?

    Answer: ArrayList

  7. How would you make a copy of an entire Java object with its state?

    Answer: Have this class implement Cloneable interface and call its method clone().

  8. How can you minimize the need of garbage collection and make the memory use more effective?

    Answer: Use object pooling and weak object references.

  9. There are two classes: A and B.The class B need to inform a class A when some important event has happened.What Java technique would you use to implement it?

    Answer: If these classes are threads I'd consider notify() or notifyAll().For regular classes you can use the Observer interface.

  10. What access level do you need to specify in the class declaration to ensure that only classes from the same directory can access it?

    Answer: You do not need to specify any access level, and Java will use a default package access level.

« Previous || Next »

Core Java Sample Question Number : 1-10| 11-20| 21-30| 31-40| 41-50| 51-60| 61-70| 71-80| 81-87|
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.