Kamal Institute of Higher Education and Advance
Technology
(Affiliated to Guru Gobind Singh Indraprastha University)
K-1 Extension,
Mohan Garden
New Delhi
110059
Practical File of
Java Programming
BCA Batch
(2023 – 2026)
Submitted to: Submitted by:
Mr. Anil Kumar Namo Narayan Shukla
(Assistant Professor) (1096702023)
Index
[Link] Programs Sign
1 Write a program to demonstrate use of method
overloading to calculate area of square, rectangle
and triangle.
2 Write a program to demonstrate the use of static
variable, static method and static block.
3 Write a program to implement inline function.
4 Write a program using switch statement.
5 Write a program using constructor.
6 Write a program to demonstrate concept of nested
Interfaces.
7 Write a program to demonstrate multi-level and
hierarchical inheritance.
8 Write a program to demonstrate Overloading.
9 Write a program to demonstrate concept of this.
10 Write a program to demonstrate unchecked
exception.
11 Have unique methods and same data members.
Write a program to demonstrate the concept of
interface when two interface.
12 Write a program to demonstrate the concept of
abstract class with constructor and "final" method.
13 Write a program to demonstrate creation of
multiple child threads.
14 Write a program to perform operation on complex
number using classes & methods.
15 Write a program to use Byte stream class to read
from a text file and display the content on the
output stream.
16 Write a program declaring a class Rectangle with
data member's length and breadth and member
functions Input, Output and CalcArca.
17 Write a Java program to create a class called
"Reservation" with attributes for reservation ID,
customer name, and date. Create subclasses
"Resort Reservation" and "Railway Reservation"
that add specific attributes like room number for
hotels and seat number for flights. Implement
methods to check reservation status and modify
reservation details.
18 Write a program Of Wrapper Class.
19 Write a program to add and subtract two complex
no using classes.
20 Write a Java program to perform basic Calculator
operations. Make a menu driven program to select
operation to perform (+-*/). Take 2 integers and
perform operation as chosen by user.
21 Write a program creating 2 threads using Runnable
interface. Print your name in "run ()" method of
first class and "Hello Java" in "run ()" method of
second thread.
Q1: Write a program to demonstrate use of method overloading
to calculate area of square, rectangle and triangle.
Output:
Q2: Write a program to demonstrate the use of static variable,
static method and static block.
Output:
Q3: Write a program to implement inline function.
Output:
Q4. Write a program using switch statement.
Output:
Q5: Write a program using constructor.
Output:
Q6: Write a program to demonstrate concept of nested Interfaces.
Output:
Q7: Write a program to demonstrate multi-level and hierarchical
inheritance.
Output:
Q8: Write a program to demonstrate overloading.
Output:
Q9: Write a program to demonstrate concept of this.
Output:
Q10: Write a program to demonstrate unchecked exception.
Output:
Q11: Have unique methods and same data members. Write a
program to demonstrate the concept of interface when two
interface.
Output:
Q12: Write a program to demonstrate the concept of abstract
class with constructor and "final" method.
OUTPUT-
Q13: Write a program to demonstrate creation of multiple child
threads.
Output:
Q14: Write a program to perform operation on complex number
using classes & methods.
Output:
Q15: Write a program to use Byte stream class to read from a text
file and display the content on the output stream.
Output:
Q16. Write a program declaring a class Rectangle with data
member's length and breadth and member functions Input,
Output and CalcArca.
Output:
Q17: Write a Java program to create a class called "Reservation"
with attributes for reservation ID, customer name, and date.
Create subclasses "Resort Reservation" and "Railway
Reservation" that add specific attributes like room number for
hotels and seat number for flights. Implement methods to check
reservation status and modify reservation details.
Output:
Q18: Write a program Of Wrapper Class.
Output:
Q19: Write a program Of Wrapper Class.
Output:
Q20: Write a Java program to perform basic Calculator
operations. Make a menu driven program to select operation to
perform (+-*/). Take 2 integers and perform operation as chosen
by user.
OUTPUT-
Q21: Write a program creating 2 threads using Runnable
interface. Print your name in "run ()" method of first class and
"Hello Java" in "run ()" method of second thread.
OUTPUT-