INDEX
S.NO LIST OF PROGRAMS PAGE SIGNATURE
NO
1 Create a class named 'Student' with String variable
'name' and integer variable 'roll_no'. Assign the
value of roll_no as '2' and that of name as "John" by
creating an object of the class Student
2 Print the average of three numbers entered by user
by creating a class named 'Average' having a
method to calculate and print the average.
3 Write a program that would print the information
(name, year of joining, salary, address) of three
employees by creating a class named 'Employee'.
4 Write a program to print the area and perimeter of
a triangle having sides of 3, 4 and 5 units by creating
a class named 'Triangle' with constructor having the
three sides as its parameters.
5 Create a class called 'Matrix' containing constructor
that initializes the number of rows and number of
columns of a new Matrix object. The Matrix class has
the following information: a. number of rows of
matrix b. number of columns of matrix c. elements
of matrix in the form of 2D array
6 Write a program to print the names of students by
creating a student class. If no name is passed while
creating an object of Student class, then the name
should be "Unknown", otherwise the name should
be equal to the String value passed while creating
object of Student class.
7 Create a class named 'Member' having the
following members: Data members 1. Name 2. Age
3. Phone number 4. Address 5. Salary It also has a
method named 'print Salary' which prints the salary
of the members. Two classes 'Employee' and
'Manager' inherits the 'Member' class. The
'Employee' and 'Manager' classes have data
members 'specialization' and 'department'
respectively. Now, assign name, age, phone number,
address and salary to an employee and a manager
by making an object of both of these classes and
print the same
8 Create a class with a method that prints "This is
parent class" and its subclass with another method
that prints "This is child class". Now, create an
object for each of the class and call 1. method of
parent class by object of parent class 2. method of
child class by object of child class 3. method of
parent class by object of child class
9 Write a program to perform inheritance where
animal is the superclass and cat is the subclass.
10 Write a java program to calculate the average value
of array elements where array elements are
{20,30,25,25, - 16,60, -100}
11 Program to calculate any shape area while using
Encapsulation.
12 Program to perform Overloading by changing
datatypes of parameters.