Important Questions for OOPs with Java
1. Explain the use and importance of access specifiers in Java (private, public, protected, and
default).
2. Differentiate between Byte Stream and Character Stream, including the class hierarchy.
3. What are Sealed Classes in Java? Explain briefly.
4. What is the purpose of the forEach() method in Java?
5. List and describe key properties of classes in Java.
6. Explain the Iterator interface in Java and its usage.
7. How does starter dependency function in a Spring Boot module?
8. Define Polymorphism in Java. How do Runtime and Compile-time Polymorphism differ? Provide
examples.
9. What is Multithreading in Java? Discuss ways to implement it and differentiate between a process
and a thread.
10. Explain Functional Interfaces and Lambda Expressions. Write a lambda program to convert a
string to upper and lower case.
11. Compare ArrayList and LinkedList in Java Collections. Demonstrate their methods with a
program.
12. What is Autowiring in Spring Boot? Describe Lifecycle Callbacks with examples.
13. Explain the concept and application of constructors in Java. Write a class 'Student' with
attributes and an all-arguments constructor to create objects.
14. Differentiate between Method Overriding and Method Overloading, and between Abstraction and
Interface.
15. Describe Exception Handling in Java. Explain try & catch, throw & throws, and checked &
unchecked exceptions.
16. Explain Java File I/O with class hierarchy. Write a program to read and write data to a file.
17. Describe new Java features: Base64 Encoding/Decoding, Switch Expressions, Yield Keyword,
and Records.
18. Explain the concepts of Try-with-Resources, Type Annotations, Repeating Annotations, and
Text Blocks in Java.
19. Compare HashMap, LinkedHashMap, and TreeMap classes in Java with program examples.
20. Explain sorting in Java using Comparable and Comparator interfaces.
21. Describe the structure of a Spring Boot project and the concept of AOP (Aspect-Oriented
Programming).
22. What are Rest Controllers in Spring Boot? Explain Request Mapping and Request Body
annotations.