Java Programmer Interview Questions

  1. What is the purpose of finalization?
  2. What is the difference between the Boolean & operator and the && operator?
  3. How many times may an object’s finalize() method be invoked by the garbage collector?
  4. What is the purpose of the finally clause of a try-catch-finally statement?
  5. What is the argument type of a program’s main() method?
  6. Can a double value be cast to a byte?
  7. What is the difference between a break statement and a continue statement?
  8. What must a class do to implement an interface?
  9. What is the advantage of the event-delegation model over the earlier event-inheritance model?
  10. How are commas used in the intialization and iteration parts of a for statement?
  11. What is an abstract method?
  12. What value does read() return when it has reached the end of a file?
  13. Can a Byte object be cast to a double value?
  14. What is the difference between a static and a non-static inner class?
  15. If a variable is declared as private, where may the variable be accessed?
  16. What is an object’s lock and which object’s have locks?
  17. What is the % operator?
  18. When can an object reference be cast to an interface reference?
  19. Which class is extended by all other classes?
  20. Can an object be garbage collected while it is still reachable?
  21. Is the ternary operator written x : y ? z or x ? y : z ?
  22. How is rounding performed under integer division?
  23. What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
  24. What classes of exceptions may be caught by a catch clause?
  25. If a class is declared without any access modifiers, where may the class be accessed?
  26. Does a class inherit the constructors of its superclass?
  27. What is the purpose of the System class?
  28. Name the eight primitive Java types.
  29. Which class should you use to obtain design information about an object?