Java J2EE Interview Questions and Answers
Java Language Fundamentals Questions 1
2. Is Java a pure object oriented language ?
3. Explain encapsulation
4. Explain inheritance
5. Explain polymorphism
6. What are classes and objects? What is the relationship between them?
7. What do you understand by API
8. Name atleast 10 Java API class you have used while programming
9. What are reserved words in Java ?
10. What is size of int in Java?
11. What is the difference between Java Key words and reserved words?
12. What do you understand by private, protected and public?
A. private, protected and public are access modifiers.
13. Public is least restrictive while private is most restrictive.
14. How many static init can you have?
A. As many as you can
15. What is reference in Java?
16. Explain main() method modifiers?
17. In system.out.println what is out and println ? Can this be redirected to a file ? How ?
18. What is the difference between instanceof and isInstance?
19. What is an instance variable and instance method?
20. Explain terms subclass and superclass.
21. What is the difference between string and stringbuffer ?
22. What is the purpose of garbage collection?
A. The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources may be reclaimed and reused.
23. What do you mean by Classpath and Classloader?
A. Classpath is the path where Compiller / JRE looks for dependent java sources
24. Classloader loads the classes into the Java virtual machine.
25. What package in java is implicitly imported
A. java.lang
26. What is the difference between a field variable and local variable?
A. A field variable is declared as a member of a class. A local variable is declared in a method (local to a method).
27. Significance of this and super() in constructors
28. What is a constructor?
29. What is reflection? What do you understand by Class.forName()
30. Does importing a package imports the subpackages as well?
31. What is the difference between declaring a variable and defining a variable?
32. What is the difference of signed and unsigned integer?
33. Significance of interface in java?