Java Day1 AN
Java Day1 AN
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
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.
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
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.
First thread generates multiplication table of 2. Second thread generates the
multiplication table of 5. Third thread gives the multiplication table of 7. Display the
output interchangeably with proper delay.
QP CODE: S506AN108 Time: 3 Hours
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a program using swing to accept values in two textboxes and display the results
of mathematical operations in third text box. Use four buttons add, subtract, multiply
and divide.
2. Write a Java Program to calculate the Result. Result should consist of name, seatno,
date, center number and marks of semester three exam. Create a User Defined
Exception class MarksOutOfBoundsException, If Entered marks of any subject is
greater than 100 or less than 0, and then program should create a user defined Exception
of type.
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
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 to
multiply each element of a matrix with a constant value
QP CODE: S506AN110 Time: 3 Hours
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
2. Write a Java program which creates a class named 'Employee' having the following
members: Name, Age, Phone number, Address, Salary. It also has a method named
'printSalary( )' which prints the salary of the Employee. Two classes 'Officer' and
'Manager' inherits 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.