[Go to site: main page, start]

0% found this document useful (0 votes)
2 views20 pages

Java Programming Practical

The document is a practical file for Java programming submitted by a BCA student at IITM College of Engineering. It includes a detailed index of experiments covering various Java concepts such as classes, inheritance, exception handling, multithreading, and AWT controls. Each experiment outlines the aim, program, and expected output for learning purposes.

Uploaded by

mohdimran15568
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views20 pages

Java Programming Practical

The document is a practical file for Java programming submitted by a BCA student at IITM College of Engineering. It includes a detailed index of experiments covering various Java concepts such as classes, inheritance, exception handling, multithreading, and AWT controls. Each experiment outlines the aim, program, and expected output for learning purposes.

Uploaded by

mohdimran15568
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IITM College of Engineering

Units of IITM Group of Institution


Approved by AICTE, New Delhi & Affiliated to
Maharshi Dayanand University, Rohtak, Haryana

JAVA PROGRAMMING PRACTICAL FILE


For
BCA 4th Semester (Academic Year 2024-2027)
Subject Name: Java
Programming
Subject Code: 25IMS404MV02

Submitted by Vaibhav Negi Submitted to: Dr. Ramesh Kr. Sharma


Student Name: Vaibhav Negi Associate Professor
Registration No. 2413071293
INDEX
[Link] NAME OF QUERIES PAGES DATE SIGNATURE

1 Define a class Student with 2-3


data members for name and
age
2 Write a program to find factorial 4-5
of a number
3 Define a class Box with 6-7
constructor to initialize
dimensions
4 Demonstrate method overriding 8-9
using Animal, Dog, Cat classes
5 Implement multilevel 10-11
inheritance with
Person→Employee→Teacher
6 Implement Shape interface for 12-13
Rectangle and Circle
7 Create a user-defined package 14-15
with Calculator class
8 Demonstrate exception 16-17
handling with try-catch-finally
9 Demonstrate use of finally 18-19
block
10 Create and handle user-defined 20-21
exceptions
11 Implement multithreading by 22-23
extending Thread class
12 Implement multithreading by 24-25
implementing Runnable
interface
13 Demonstrate synchronization 26-27
in multithreading
14 Create a program using Vector 28-29
class
15 Demonstrate AWT controls 30-31
Button, Label, TextField
16
17
Experiment 1: Define a class Student with data members
for name and age
Aim: To create a class Student with data members and member functions.
Program:

Output:
Experiment 2: Write a program to find factorial of a
number
Aim: To calculate factorial of a given number using loops.
Program:

Output:
Experiment 3: Define a class Box with constructor to
initialize dimensions
Aim: To demonstrate parameterized constructor with Box class.
Program:

Output:
Experiment 4: Demonstrate method overriding using
Animal, Dog, Cat classes
Aim: To implement method overriding in inheritance hierarchy.
Program:

Output:
Experiment 5: Implement multilevel inheritance with
Person→Employee→Teacher
Aim: To demonstrate multilevel inheritance with three classes.
Program:

Output:
Experiment 6: Implement Shape interface for Rectangle
and Circle
Aim: To implement interface with multiple classes.
Program:

Output:
Experiment 7: Create a user-defined package with
Calculator class
Aim: To create and use user-defined package in Java.
Program:

Output:
Experiment 8: Demonstrate exception handling with try-
catch-finally
Aim: To handle exceptions using try-catch-finally blocks.
Program:

Output:
Experiment 9: Demonstrate use of finally block
Aim: To show that finally block always executes.
Program:

Output:
Experiment 10: Create and handle user-defined
exceptions
Aim: To create custom exception classes and handle them.
Program:

Output:
Experiment 11: Implement multithreading by extending
Thread class
Aim: To create threads by extending the Thread class.
Program:

Output:
Experiment 12: Implement multithreading by
implementing Runnable interface
Aim: To create threads by implementing the Runnable interface.
Program:

Output:
Experiment 13: Demonstrate synchronization in
multithreading
Aim: To prevent race condition using synchronized methods.
Program:

Output:
Experiment 14: Create a program using Vector class
Aim: To demonstrate the use of Vector class.
Program:

Output:
Experiment 15: Demonstrate AWT controls Button,
Label, TextField
Aim: To create a GUI application using AWT controls.
Program:

Output:

You might also like