Java Programming Questions and Answers Clean
Java Programming Questions and Answers Clean
2 Marks
Write a Java Program to create a class Employee with data members id, name, and salary. Accept
details of 5 employees and display the employee having the highest salary.
2 Marks
4 Marks or 6 Marks
Define the interface Shape with two methods: area() and perimeter(). Create two classes Circle and
Describe Packages in Java. Explain how to create and import a package with example.
2 Marks
4 Marks or 6 Marks
Write a program to print even and odd numbers using two threads.
Explain the concept of Exception Handling with syntax of try-catch-finally blocks. Provide a suitable
example.
Define exception called 'No Match Exception' that is thrown when the password accepted is not
2 Marks
4 Marks or 6 Marks
2 Marks
4 Marks or 6 Marks
2 Marks
4 Marks or 6 Marks