Additional Questions
1. Discuss exception handling in java and write a program to read 10 marks and compute its
average. Throw an exception when mark is less than 0 or a mark greater than 100 is entered and
handle the same.
2. Write a java program to add two dates. Define a class date with private instance variables day,
month, year and a function add. let the function accepts objects of date class as parameter and
return an object of the same type.
3. Develop an applet which displays three checkboxes corresponds to Linux, Windows, Mac.
Capture the event and display the status of each of the check boxes.
4. Write a java program to create two threads. Let one thread output numbers 1 to 10 and the
other output numbers from 10 to 1.
5. Write a program to create two threads simultaneously one to display even numbers and the
other to display odd numbers.
6. Create an applet to concatenate two strings given as input in text boxes on clicking button.
7. Write an applet program to find a power b where a and b is input to two text boxes on clicking
button.
8. Explain Multithreading. List any few thread management functions.
9. Write a program to retrieve an employee record from a database table using EmpNo as the
key. Let the database table contain EmpNo, Name, Department and Salary.
10. A student database stores following information about students in a class. Rollno, name,
gender, CGPA. Write a java program to prepare a rank list based on CGPA. Also display a list of
students having cgpa less than 7.

Oodp extra2

  • 1.
    Additional Questions 1. Discussexception handling in java and write a program to read 10 marks and compute its average. Throw an exception when mark is less than 0 or a mark greater than 100 is entered and handle the same. 2. Write a java program to add two dates. Define a class date with private instance variables day, month, year and a function add. let the function accepts objects of date class as parameter and return an object of the same type. 3. Develop an applet which displays three checkboxes corresponds to Linux, Windows, Mac. Capture the event and display the status of each of the check boxes. 4. Write a java program to create two threads. Let one thread output numbers 1 to 10 and the other output numbers from 10 to 1. 5. Write a program to create two threads simultaneously one to display even numbers and the other to display odd numbers. 6. Create an applet to concatenate two strings given as input in text boxes on clicking button. 7. Write an applet program to find a power b where a and b is input to two text boxes on clicking button. 8. Explain Multithreading. List any few thread management functions. 9. Write a program to retrieve an employee record from a database table using EmpNo as the key. Let the database table contain EmpNo, Name, Department and Salary. 10. A student database stores following information about students in a class. Rollno, name, gender, CGPA. Write a java program to prepare a rank list based on CGPA. Also display a list of students having cgpa less than 7.