Monday, August 27, 2012

Important Java Questions

1. Differentiate between procedural programming and object oriented programming.
2. What are interfaces?
3. Describe some advantages of interfaces.
4. What are abstract classes?
5. What are the differences between an interface and an abstract class?
6. What is method overriding and method overloading?
7. What is polymorphism?
8. What is difference between aggregation and composition association?
9. What are immutable objects? How to make an object immutable?
10. What is deadlock and livelock?
11. How to achieve synchronization in a multi-thread java programming? Method level synchronization and Block level synchronization. Static method synchronization.
12. How to implement a thread?
13. Difference between a thread and a process.
14. Describe a scenario where a deadlock happens.
15. How to handle exceptions in Java?
16. What is a Singleton and how to implement it?
17. Difference between Hashmap and Hashtable?
18. Difference between Vector  and LinkedList?
19. Regular Expressions in Java?
20. Difference between inheritence and composition ?
21. Difference between comparator and comparable interfaces?
21. Design patterns in oops programming?
22. What are re-entrant locks?
23. Difference between implicit and explicit locking?
24. What are marker interfaces?
25. What is the difference between a concurrent hashmap and concurrency achieved using synchronized keyword?
26.What is the difference between an enumerator and an iterator? Which is fail-safe and which one is fail-fast?
27. What is difference between a volatile variable and a ThreadLocal variable?
28. can an interface declare a private method?
29. can a constructor throw an exception?
30. A method declaration in an interface has throws exception. is it necessary for implementing class to throw an exception?
31. What are generics?
32. How to determine the datatype of a generic type?
33. What is a race condition in a software?
34. What is a phantom reference?

No comments:

Post a Comment