IITM College of Engineering
Practical File
Object-Oriented Programming using
Java SUBJECT- CODE: 25BCA402SEC01
SUBMITTED TO: SUBMITTED BY:
Ms. Pooja Dalal Student Name
(Assistant Professor) Course /Sec: BCA II
Reg-No. :
Department of Computer Science and Engineering
IITM College of Engineering, Bahadurgarh
Affiliated to Maharshi Dayanand University,
Rohtak Session 2025-26
INDEX
[Link] List of Experiments Date Signature
1. Write a program to read two numbers from user
and print their product.
2. Write a program to print the square of a number
passed through command line arguments.
3. Write a program to send the name and surname
of a student through command line arguments
and print a welcome message for the student.
4. Write a java program to find the largest number
out of n natural numbers.
5. Write a java program to find the Fibonacci series
& Factorial of a number using recursive and non
recursive functions.
6. Write a java program to multiply two given
matrices.
7. Write a Java program for sorting a given list of
names in ascending order.
8. Write a Java program that checks whether a
given string is a palindrome or not . Ex: MADAM
is a palindrome.
9. Write a java program to read n number of values
in an array and display it in reverse order.
10. Write a Java program to perform mathematical
operations. Create a class called Add Sub with
methods to add and subtract. Create another
class called Mul Div that extends from Add Sub
class to use the member data of the superclass.
Mul Div should have methods to multiply and
divide A main function should access the methods
and perform the mathematical operations.
11. Create a JAVA class called Student with the
following details as variables within it.
a. USN, NAME, BRANCH, PHONE,
PERCENTAGE
b. Write a JAVA program to create n
Student objects and print the USN,
Name, Branch, Phone, and
percentage of these objects with
suitable headings.
12. Write a Java program that displays the number of
characters, lines and words in a text.
13. Write a Java program to create a class called
Shape with methods called get Perimeter() and
get Area(). Create a subclass called Circle that
overrides the get Perimeter() and get
Area()methods to calculate the area and
perimeter of a circle.
14. Write a Java program to create a class Employee
with a method called calculate Salary(). Create
two subclasses Manager and Programmer. In each
subclass, override the calculate Salary() method to
calculate and return the salary based on their
specific roles.
15. Write a Java program using an interface called
‘Bank’ having function ‘rate of interest()’.
Implement this interface to create two separate
bank classes ‘SBI’ and ‘PNB’ to print different rates
of interest. Include additional member variables,
constructors also in classes ‘SBI’ and ‘PNB’.
16. Write a Java package program for the class book
and then import the data from the package and
display the result.
17. Write a Java program for finding the cube of a
number using a package for various data types
and then import it in another class and display the
results.
18. Write a Java program for demonstrating the divide
by zero exception handling.
19. Write a Java program that reads a list of
integers from the user and throws an
exception if any numbers are duplicates.
20. Create an exception subclass Underage,
which prints “Under Age” along with
the age value when an object of
Underage class is printed in the catch
statement. Write a class exception
Demo in which the method test()
throws Underage exception if the
variable age passed to it as argument is
less than 18. Write main() method also
to show working of the program.