Download Java QUIZ

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Java QUIZ
1) What is a possible output of the following program ? Is it unique ? Will the program complete ? If
not, what change would you make so it does complete ? (by moving one line up or down).
2) Briefly describe the “Factory Method” pattern and How does it promote loosely coupled code and
Polymorphism ?
3) What are the measures “Cohesion” and “Coupling” in Software Development ? How these
measures can help creating flexible and extensible software ?
4) What are Concrete Classes versus Abstract Classes versus Interfaces in Java ? Briefly describe the
differences between them.
5) How can you minimize the need for Garbage Collection and make memory usage more efficient ?
6) How can you effectively kill a java thread that is blocked waiting on some IO operation (a reading
socket for instance) ?
7) What can make a java thread return from the wait() method ?
8) How can you prevent a java class from being derived or subclassed ?
9) Is the below a legal java code ? What’s the problem with this design and would be a better approach
to this problem ?
10) Why would you use a synchronized block vs. synchronized method?
End of QUIZ