MEERUT INSTITUTE OF ENGINEERING & TECHNOLOGY, MEERUT
Question Bank
CS 2nd Year (Even Semester)
Subject Name: Object Oriented Programming with Java
Subject Code: BCS403
Unit-1(CO1)
1. What are the features of Java?
2. What is the difference between JDK, JRE, and JVM?
3. What is the difference between a class and an object?
4. What are the four principles of OOP?
5. What are access modifiers?
6. What is encapsulation, polymorphism, and abstraction?
7. What is a constructor? Explain types of constructor.
8. What do you understand by an instance variable and a local variable?
9. Explain the use of final keyword in variable, method and class.
10. When can you use super keyword?
11. Why is the main method static in Java?
12. Difference between static methods, static variables, and static classes in java.
13. What is the purpose of the static keyword in Java?
14. Explain the concept of inheritance with types in Java through examples
15. How do you create and use an array in Java?
16. What is method overloading and overriding with example in Java?
17. What is the purpose of the final keyword when used with a variable?
18. What is the difference between an abstract class and an interface?
19. Define Packages in Java. Explain the usage of Java packages
20. Explain steps to create package and import it with example.
Unit-2(CO2)
21. What is exception handling in Java and what are the advantages of exception handling?
22. Write a Java program that throws an exception and catch it using a try-catch block.
23. What is the difference between checked and unchecked exceptions in Java? Give examples of
each.
24. Explain the flow of control when an exception is thrown inside a try block. What happens if
there is no matching catch block?
25. What is the role of the finally block in exception handling? Can it be used without a catch block?
26. How do the throw and throws keywords differ in Java? Explain with code examples.
27. How would you create a custom (user-defined) exception in Java? When would you prefer to do
so over using built-in exceptions?
28. What is stream in java? Explain inputstream and outputstream class.
29. Explain FileInputStream and Fileoutputstream class with example.
30. What is the difference between byte streams and character streams in Java? When would you
use one over the other?
31. Explain Bufferedinputstream and BufferedOutputStream with eample.
32. Write a Java program that reads data from a file and writes it to another file using character
streams.
33. What are the two ways of implementing thread in Java?
34. What's the difference between thread and process?
35. Explain FileReader and FileWriter class with example.
36. Describe the life cycle of a thread in Java with a diagram or flow. What methods are used to
control the state transitions?
37. How do thread priorities affect the execution of threads in Java? Can thread priority guarantee
execution order?
38. What is inter-thread communication in Java? How are wait(), notify(), and notifyAll() used in this
context?
39. Explain Scanner class with example in java.
40. Explain BufferedReader and BuffferedWriter class with example in Java.
Unit-3(CO3)
41. What is Functional interface? Explain with example.
42. What is the use of lamda expression? Write its syntax.
43. Explain different types of method reference with syntax.
44. Differentiate between yield and return keyword.
45. What do you meant by Encode64 and decode?
46. Define annotation and its types.
47. What do you meant by sealed classes? Explain with the help of program.
48. What is the use of default and static method?
49. What is the use of try with resources?
50. What do you meant by StreamAPI?
51. How to use lamda expression for thread? Write a program for same.
52. Define method reference.
53. Explain Repeating Annotation used in java.
54. What is java module? Explain with advantages.
55. Explain diamond problem in java.
56. Differentiate between switch statement and switch expression.
57. Explain Switch expression with example.
58. Explain Text block in java With example.
59. Explain Record in Java with benefit and syntax.
60. Explain Sealed class with example.
Unit-4(CO4)
61. Describe the hierarchy of the Collection Framework in Java.
62. Differentiate between Array and collection.
63. How do you reverse an ArrayList?
64. Name the differences between collection and Collections.
65. List the differences between Array and ArrayList.
66. Explain the differences between Iterator and ListIterator.
67. Differentiate between iterator and enumeration.
68. How do you make an ArrayList read-only in Java?
69. Name the differences between ArrayList and Vector.
70. What are the differences between ArrayList and LinkedList?
71. Differentiate between set and map.
72. How do you sort an ArrayList in descending order?
73. What are the differences between HashSet and TreeSet.
74. List the differences between comparable and comparator.
75. Name the differences between queue and stack.
76. What are the methods that Java Stack class provide?
77. What are the uses of Properties class and the advantages of Properties file?
78. Differentiate between HashMap and Hashtable.
79. How do you implement HashSet in Java and how does it use hashing?
80. Explain the differences between HashMap and TreeMap.
Unit-5(CO5)
81. Discuss the role of Spring Framework?
82. Explain dependency injection with example.
83. What do you mean by Spring Inversion of Control (IOC.
84. Implement Auto wring through example.
85. What is AOP?
86. Explain Bean scope of Singleton.
87. Explain Prototype in Spring Framework.
88. Explain web socket.
89. Explain Life cycle call back.
90. Explain bean configuration style.
91. Discuss the role of Annotations in Spring Framework.
92. Discuss Spring Boot Code Structure.
93. What do you mean by Spring Boot Runners?
94. Explain logger in spring boot.
95. Explain path variable in spring boot.
96. Explain Restful Web Services.
97. Discuss the role of GET, POST, PUT and DELETE request parameters.
98. What is the role of request mapping and request body?
99. Differentiate between spring boot and spring framework.
100. Explain advantages of spring boot.