Posted in All Posts, Semester 4

Sem 4 – CJ Unit 3 Programs

CJ – Core Java

Unit 3 – Exception Handling and Inheritance

1. Write a program to display the sum of digits of given numbers with exception handling.
Download

2. Write a java program which takes 2 arguments – a string and its length. If the length of the string is not according to given one then throw the user defined LengthMatchException and handles it appropriately.
Download

3. Write a Java program to input n integer numbers and display lowest and second lowest number. Also handle the different exceptions possible to be thrown during execution.
Download

4. Write a java program that accepts 5 even numbers from command line. If any of the number is odd then throw custom exception OddException and count such invalid numbers.
Download

5. Write a program to define custom exception called “no match exception” that is thrown when a string is not equal to “internet” This string is providing through command line argument.
Download

6. Consider an employee class, which contains fields such as name and designation. And a subclass, which contains a field salary. Write a program for inheriting this relation.
Download

7. Consider an employee class, which contains fields such as name and designation. And a subclass, which contains a field salary. Write a program for inheriting this relation.
Download

8. Write a class with a method to find the area of a rectangle. Create a subclass to find the volume of a rectangular shaped box.
Download

9. Write a program to calculate arithmetic mean in the superclass and standard deviation in the subclass
Download

Download All Programs

I hope that you found this article to be helpful.
Please share your thoughts in the Comments Section.

Please like our Facebook page to show your support.

Suggested Reading

Comment your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.