Java Mock Exam Questions
1. Explain the concept of platform independence in Java. Why is bytecode important?
2. Differentiate between method overloading and method overriding with examples.
3. What are checked and unchecked exceptions? Give two examples of each.
4. Write a Java program to count the number of vowels in a given string.
5. Explain the difference between an abstract class and an interface. When would you use one over
the other?
6. Describe the life cycle of a thread in Java with a neat diagram.
7. List and explain the steps required to connect a Java program with a database using JDBC.