Questions JDOC ch1 ch7
Questions JDOC ch1 ch7
2. Explain the concept of Java’s "Write Once, Run Anywhere" (WORA) principle.
3. How does Java achieve platform independence?
4. What is the role of the main method in a Java program?
5. What is the difference between JDK, JRE, and JVM?
6. What are coding conventions in Java, and why are they important?
7. What are primitive data types in Java and reference types? List them with examples.
8. What is the difference between widening and narrowing type conversion?
9. Explain control flow statements
10. What is Jshell? How is it useful?
11. How is String different from StringBuilder in Java?
12. What are wrapper classes? Why are they needed?
13. Explain the use of BigDecimal in Java.
14. What are some methods available in the String class?
15. What is the difference between LocalDate, LocalTime, and LocalDateTime?
16. What is method overloading? Give an example.
17. What is the purpose of constructors in Java?
18. What is encapsulation? How is it implemented in Java?
19. What is immutability? How do you create an immutable class?
20. What is an enumeration (enum), and how is it used?
21. What is inheritance? How is it implemented in Java?
22. What is the super keyword used for?
23. Discuss the access modifier with examples and scope.
24. How does method overriding work in Java?
25. What is the difference between final classes and abstract classes?
26. Explain the concept of polymorphism with an example.
27. What is an interface in Java? How is it different from an abstract class?
28. How do you implement an interface in Java?
29. What is a default method in an interface?
30. Can an interface have constructors? Why or why not?
31. What is the significance of functional interfaces?
32. Discuss equals and == operator with examples.