COER UNIVERSITY
7th K.M, on Roorkee Haridwar Road(NH-58)
Post Box [Link],
Roorkee-247667, [Link]
(UTTARAKHAND)
[Link]
LAB SHEETS
Submitted By: Chetan Gaur
Submitted To: Ms. Nidhi Rana
Program: [Link]
Department: CSE
Section: B
Subject Name: Advance Java Programming (BTCS583)
1
LABSHEET 01
1. Method Overloading for a Calculator Class
Objective: Implement method overloading within a single
class to handle different data types and parameter counts.
Code:-
Output:-
2
2. Method Overriding for a Vehicle Hierarchy
Objective: Demonstrate method overriding by creating a
parentchild class relationship.
Code:-
Output:-
3
3. Overloading and Overriding Combined
Objective: Apply both overloading and overriding in a class
hierarchy.
Code:-
Output:-
4
LABSHEET 02
1. Objective: Java program that demonstrates the various uses of
the static keyword, including static variables, methods,
blocks, and nested classes. The code is fully commented to
help you understand each part.
Code:-
Output:-
5
2. Objective:Write a program in java to demonstrate how
command line arguments are handled in java.
Code:-
Output:-
6
3. Objective: Write a program in java to demonstrate the concept
of dynamic method dispatch.
Code:-
Output:-
7
Objective: Student Grade Calculator.
Code:-
8
Output:-
9
10
LABSHEET 03
1. Objective:Write a Java program to print "Welcome Thread One"
and "Welcome Thread Two " continuously on the screen in Java
using threads.
11
Output:-
12
2. Objective: Demonstrate gerPriority() and setPriority() methods in
Java threads.
Output:-
3. Write Java code to create a thread using the Thread class and the
Runnable interface.
13
14
4. Write a JAVA program to illustrate how to interrupt a thread in
Java.
15
5. Write a Java program to implement a program to demonstrate
thread synchronization using the synchronized keyword.
16
Output:-
17