The document contains a list of basic questions related to Java programming, covering topics such as key differences between C++ and Java, the concept of constructors, static variables and methods, garbage collection, and the Java platform. It also addresses access specifiers, the purpose of keywords like final, finally, and finalize, and the distinctions between JDK, JRE, and JVM. Overall, it serves as a foundational guide for understanding essential Java concepts.
The document contains a list of basic questions related to Java programming, covering topics such as key differences between C++ and Java, the concept of constructors, static variables and methods, garbage collection, and the Java platform. It also addresses access specifiers, the purpose of keywords like final, finally, and finalize, and the distinctions between JDK, JRE, and JVM. Overall, it serves as a foundational guide for understanding essential Java concepts.
1. What are the key differences between C++ and Java?
2. Which class is a superclass of all classes? 3. What is the static keyword? 4. What are finally and finalize in Java? 5. What is break and continue statement? 6. What is an object? 7. What is the constructor? 8. How many types of constructors are used in Java? 9. Does constructor return any value? 10. Is constructor inherited? 11. Can you make a constructor final? 12. Can we overload the constructors? 13. What are the differences between the constructors and methods? 14. What is the static variable? 15. What are the restrictions that are applied to the Java static methods? 16. Why is the main method static? 17. Can we override the static methods? 18. What is the static block? 19. Can we make constructors static? 20. Can we make the abstract methods static in Java? 21. Can we declare the static variables and methods in an abstract class? 22. What are the main uses of this keyword? 23. What is super in java? 24. What are the differences between this and super keyword? 25. What is the final keyword in java? 26. Can you declare the main method as final? 27. Can we declare a constructor as final? 28. How is an infinite loop declared in Java? 29. Do final, finally and finalize keywords have the same function? 30. What is the main objective of garbage collection? 31. What is the use of System class in Java? 32. What is the difference between JDK, JRE, and JVM? 33. What is JIT compiler? 34. What is the platform? 35. Is delete, next, main, exit or null keyword in java? 36. What if I write static public void instead of public static void? 37. What is the default value of the local variables? 38. What are the various access specifiers in Java? 39. What is the purpose of static methods and variables? 40. What are the advantages of Packages in Java? 41. What are the differences between JVM, JRE and JDK in Java? 42. Java works as “pass by value” or “pass by reference” phenomenon? 43. Why is Java a platform independent language? 44. Why is Java not a pure object oriented language? 45. Pointers are used in C/ C++. Why does Java not make use of pointers? 46. What do you understand by an instance variable and a local variable?