Java 3 edited
Java 3 edited
2. Create a package named Shapes and define abstract class Shape inside it. The Shape
class should have an abstract method getArea(). Define two subclasses Rectangle and
Circle that extend the Shape class and implement the getArea() method. Create a class
FindArea in a different package and use the Rectangle and Circle classes to find the
areas of a rectangle and a circle.
1. Write a swing program to accept a value in a textbox then find the area of a circle and
display the result in the second textbox.
2. Write a Java program that implements a multi-thread application that has three threads.
The first thread generates a multiplication table of 2. The second thread generates the
multiplication table of 5. The third thread gives the multiplication table of 7. Display
the output interchangeably with proper delay.
1. Write a program using Swing to accept values in two textboxes and display the results
of mathematical operations in the third text box. Use four buttons add, subtract,
multiply, and divide.
2. Write a Java Program to calculate the Result. The result should consist of name, seatno,
date, center number, and marks of the semester three exam. Create a User-Defined
Exception class MarksOutOfBoundsException, If Entered marks of any subject are
greater than 100 or less than 0, then the program should create a user-defined Exception
of type MarksOutOfBoundsException and must have a provision to handle it.
2. Create a class called Matrix which contains a 2d integer array, m & n (order of matrix)
as data members. Include the following member functions
a. To read the matrix,
b. To display the matrix,
c. Overload a method product () to find the product of two matrices and multiply
each element of a matrix with a constant value
1. Write a swing program to interchange the values of two textboxes.
2. Write a Java program that creates a class named 'Employee' having the following
members: Name, Age, Phone number, Address, and Salary. It also has a method named
'printSalary( )' which prints the salary of the Employee. Two classes 'Officer' and
'Manager' inherit the 'Employee' class. The 'Officer' and 'Manager' classes have
data members 'specialization' and 'department' respectively. Now, assign name, age,
phone number, address, and salary to an officer and a manager by making an object of
both of these classes and print the same.