JAVA PROGRAMMING QUESTION BANK
1. 1. What is bytecode in Java and which component executes it?
2. 2. Differentiate between method overloading and method overriding.
3. 3. What is the purpose of the throw keyword in Java?
4. 4. Define Functional Interface with one example.
5. 5. What is the difference between HashSet and TreeSet?
6. 6. What is the role of JRE in Java programming?
7. 7. Define encapsulation in Java.
8. 8. What is thread synchronization?
9. 9. What is the use of Stream API in Java?
10. 10. Differentiate between Comparable and Comparator interfaces.
11. 11. Explain the Java compilation process from source code to bytecode execution
using JVM.
12. 12. Write a Java program to demonstrate constructor overloading and explain its
output.
13. 13. Explain checked and unchecked exceptions. Write a program to handle
ArrayIndexOutOfBoundsException.
14. 14. Write a Java program using Lambda Expression to print the square of numbers
stored in a list.
15. 15. Compare ArrayList and LinkedList. Write suitable situations where each should
be preferred.
16. 16. Explain the importance of JVM architecture and its components in Java
execution.
17. 17. Write a Java program to demonstrate method overloading using different
parameter lists.
18. 19. Write a Java program using try-with-resources to read data from a file.
19. 20. Explain the hierarchy of Collection Framework in Java with suitable examples.
20. 21. Write a Java program to take marks of 5 students using arrays and display the
highest marks obtained. Explain the logic used.
21. 22. Explain data types, operators, and control flow statements in Java with a
suitable program example.
22. 23. Explain Java source file structure and discuss the role of comments, variables,
and operators with examples.
23. 24. Write a Java program to perform arithmetic operations using switch-case
statements and explain the output.
24. 25. Write a Java program demonstrating inheritance using superclass and subclass
concepts. Show method overriding in the program.
25. 26. Create an interface named Shape with a method area(). Implement the interface
for Circle and Rectangle classes.
26. 27. Write a Java program demonstrating polymorphism using method overriding
and dynamic method dispatch.
27. 28. Explain packages in Java. Write the steps to create a user-defined package and
import it into another class.
28. 29. Write a Java program using try-catch-finally to handle division by zero exception
and explain the output.
29. 30. Write a multithreading Java program where two threads print even and odd
numbers simultaneously.
30. 31. Write a Java program to create multiple threads using the Runnable interface
and explain thread priorities.
31. 32. Explain exception propagation in Java with a suitable program example using
throws keyword.
32. 33. Write a Java program using Stream API to filter student marks greater than 75
from a list entered by the user.
33. 34. Explain Method References in Java 8. Write a program demonstrating the use of
method reference with forEach().
34. 35. Write a Java program demonstrating the use of Functional Interface and
Lambda Expression for addition of two numbers.
35. 36. Explain Base64 Encoding and Decoding in Java with a suitable example program.
36. 37. Write a Java program to store employee details using HashMap and display all
records using [Link].
37. 38. Write a Java program to sort student names using Comparable or Comparator
interface and explain the difference between them.
38. 39. Write a Java program to demonstrate the working of TreeSet and
LinkedHashSet. Compare their outputs.
39. 40. Create a Java program using Hashtable to store and retrieve student records.
Explain how Hashtable differs from HashMap.
40. 41. Explain the difference between JDK, JRE, and JVM.
41. 42. What are the main features of Java?
42. 43. Differentiate between compile-time polymorphism and runtime polymorphism.
43. 44. Explain inheritance and its types in Java.
44. 45. What is abstraction? Differentiate between abstract class and interface.
45. 46. Explain exception handling mechanism in Java.
46. 47. Differentiate between Thread class and Runnable interface.
47. 48. Explain Lambda Expressions with syntax and examples.
48. 49. Differentiate between HashSet, LinkedHashSet, and TreeSet.
49. 50. Explain the use of this and super keywords in Java.
50.