0% found this document useful (0 votes)
6 views89 pages

Java LabManual

The document is a laboratory manual for a Diploma in Engineering course focused on Java Programming. It outlines the vision and mission of the Directorate of Technical Education, the objectives of the practical work, and the expected outcomes for students. The manual includes guidelines for both faculty and students, as well as a series of practical exercises designed to develop industry-relevant skills in Java programming.

Uploaded by

Sanjay Sampat
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)
6 views89 pages

Java LabManual

The document is a laboratory manual for a Diploma in Engineering course focused on Java Programming. It outlines the vision and mission of the Directorate of Technical Education, the objectives of the practical work, and the expected outcomes for students. The manual includes guidelines for both faculty and students, as well as a series of practical exercises designed to develop industry-relevant skills in Java programming.

Uploaded by

Sanjay Sampat
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

Diploma Engineering

Laboratory Manual
(Java Programming)
(DI03032021)

[Information and Communication Technology, Semester III]


Enrolment No
Name
Branch
Academic Term
Institute

Directorate Of Technical Education


Gandhinagar - Gujarat
CTE’s Vision:
To facilitate quality technical and professional education having relevance for both industry and society,with
moral and ethical values, giving equal opportunity and access, aiming to prepare globally competent
technocrats.

CTE’s MISSION
1. Quality technical and professional education with continuous improvement of all the resources and
personnel
2. To promote conducive ecosystem for Academic, Industry, Research, Innovations and Startups

3. To provide affordable quality professional education with moral values, equal opportunities, accessibility
and accountability
4. To allocate competent and dedicated human resources and infrastructure to the institutions for providing
world-class professional education to become a Global Leader (“Vishwa Guru”)

Institute’s Vision:

Institute’s Mission:
Department’s Vision:

Department’s Mission:
Name of institute

Certificate

This is to certify that Mr./Ms ……………………………………………………………………………………..


Enrollment No. ……………………………………………………………. Of Semester 3 rd of Diploma in
Information and Communication Technology of Java Programming (DI03032021) has
satisfactorily completed the term work in course
…………………………………………………………………………………….……. for the academic year: 2025-26
Term: Odd prescribed in the GTU curriculum.

Place: Rajkot

Date: …………………..

Signature of Course Faculty Head of the Department


Preface
The primary aim of any laboratory/Practical/field work is enhancement of required skills as well as
creative ability amongst students to solve real time problems by developing relevant competencies in
psychomotor domain. Keeping in view, GTU has designed competency focused outcome-based curriculum -
2021 (COGC-2021) for Diploma engineering programmes. In this more time is allotted to practical work than
theory. It shows importance of enhancement of skills amongst students and it pays attention to utilize every
second of time allotted for practical amongst Students, Instructors and Lecturers to achieve relevant outcomes
by performing rather than writing practice in study type. It is essential for effective implementation of
competency focused outcome- based Green curriculum-2021. Every practical has been keenly designed to serve
as a tool to develop & enhance relevant industry needed competency in each and every student. These
psychomotor skills are very difficult to develop through traditional chalk and board content delivery method in
the classroom. Accordingly, this lab manual has been designed to focus on the industry defined relevant
outcomes, rather than old practice of conducting practical to prove concept and theory.

By using this lab manual, students can read procedure one day in advance to actual performance day of
practical experiment which generates interest and also, they can have idea of judgement of magnitude prior to
performance. This in turn enhances predetermined outcomes amongst students. Each and every Experiment
/Practical in this manual begins by competency, industry relevant skills, course outcomes as well as practical
outcomes which serve as a key role for doing the practical. The students will also have a clear idea of safety
and necessary precautions to be taken while performing experiment.

This manual also provides guidelines to lecturers to facilitate student-centered lab activities for each
practical/experiment by arranging and managing necessary resources in order that the students follow the
procedures with required safety and necessary precautions to achieve outcomes. It also gives an idea that how
students will be assessed by providing Rubrics.

Advanced Object-Oriented Programming course provides platform to learn object-oriented


programming concepts, techniques, and applications using the Java programming language. Object-oriented
programming emphasis on the fundamentals of the structured design with classes, including development,
testing, implementation and documentation also includes object-oriented programming techniques, classes and
objects. Java is a simple, portable, distributive, robust, secure, dynamic, architecture neutral, object-oriented
programming language.

Although we try our level best to design this lab manual, but always there are chances of improvement.
We welcome any suggestions for improvement.
Programme Outcomes (POs) to be achieved through Practical of this Course

Following programme outcomes are expected to be achieved through the practical of the
course:

1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics, science and
engineering fundamentals and engineering specialization to solve the engineering problems.

2. Problem analysis: Identify and analyze well-defined engineering problems using codified standard
methods

3. Design/ development of solutions Design solutions for well-defined technical problems and assist
with the design of systems components or processes to meet specified needs

4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools and
appropriate technique to conduct standard tests and measurements

5. Engineering practices for society, sustainability and environment: Apply appropriate


technology in context of society, sustainability, environment and ethical practices.

6. Project Management: Use engineering management principles individually, as a team member or a


leader to manage projects and effectively communicate about well-defined engineering activities.

7. Life-long learning: Ability to analyze individual needs and engage in updating in the context of
technological changes.
Practical Outcome - Course Outcome matrix
Course Outcomes (COs):

a) Write simple Java programs using basic syntax, data types, and control structures.
b) Apply object-oriented programming concepts to solve real-world problems.
c) Develop Java applications using inheritance, interfaces, and packages.
d) Implement exception handling and multithreading in Java programs.
e) Develop Java applications using file handling and collections framework.

CO
S. No. Practical Outcome CO2 CO3 CO4 CO5
1

Install JDK, write a simple "Hello World"


program, compile, and execute using Java - - - -
1. √
compiler and interpreter.

Write a Java program to implement basic


2. √ - - - -
arithmetic operations and
demonstrate type casting
Create a class to represent a Student with
3. √ - - - -
appropriate attributes and methods, then
instantiate and manipulate Student objects
Create a program that demonstrates the use
4. - √ - - -
of constructors and 'this' keyword.

Develop a program to demonstrate method


5. - √ - - -
overloading for different operations.

Implement a class with static methods,


variables, and blocks, then demonstrate
6. their behavior. - √ - - -

Create a program to demonstrate single,


multilevel, and hierarchical inheritance.
7. - - √ - -

Implement method overriding and


8. - - √ - -
demonstrate dynamic method dispatch.
Create and implement interfaces for
9. - - √ - -
multiple inheritance and define default
methods
Implement exception handling using try,
10. - - - √ -
catch, and finally blocks for different
scenarios.
Develop a multithreaded application by
extending Thread class to perform
11. concurrent tasks. - - - √ -

Develop a program to demonstrate String


12. - - - - √
class methods and string manipulation
operations.
Implement a program using ArrayList and
13. LinkedList to demonstrate List interface - - - - √
capabilities.

Develop a program to read, write, and


14. - - - - √
manipulate text files using file streams
Implement object serialization to save and
15. - - - - √
retrieve object states from files.
Industry Relevant Skills

The following industry relevant skills of the competency “Develop java application using object-oriented
approach.” are expected to be developed in the student by undertaking the practical of this laboratory
manual.

1. Develop java application using object oriented programming


2. Develop java application using exception handling, Multi-threading
3. Develop java application using java io and collections

Guidelines to Course Faculty


1. Couse faculty should demonstrate experiment with all necessary implementation strategies
described in curriculum.
2. Couse faculty should explain industrial relevance before starting of each experiment.
3. Course faculty should involve & give opportunity to all students for hands on experience.
4. Course faculty should ensure mentioned skills are developed in the students by asking.
5. Utilise 2 hrs of lab hours effectively and ensure completion of write up with quiz also.
6. Encourage peer to peer learning by doing same experiment through fast learners.

Instructions for Students


1. Organize the work in the group and make record of all observations.
2. Students shall develop coding standard skill as expected by industries.
3. Student shall attempt to develop related hand-on skills and build confidence.
4. Student shall develop the habits of evolving more ideas, innovations, skills etc.
5. Student shall refer technical magazines and data books.
6. Student should develop habit to submit the practical on date and time.
7. Student should well prepare while submitting write-up of exercise.
Java Programming (DI03032021)

Continuous Assessment Sheet

Enrolment No: Name:


Term:

Practical
Outcome / Date Marks
Sr Page Sign
Title of (25)
experiment
1. Install JDK, write a simple "Hello World"
program, compile, and execute using Java
compiler and interpreter.

2. Write a Java program to implement basic


arithmetic operations and
demonstrate type casting
3. Create a class to represent a Student with
appropriate attributes and methods, then
instantiate and manipulate Student objects
4. Create a program that demonstrates the use
of constructors and 'this' keyword.

5. Develop a program to demonstrate method


overloading for different operations.

6. Implement a class with static methods,


variables, and blocks, then demonstrate their
behavior.

7. Create a program to demonstrate single,


multilevel, and hierarchical inheritance.

8. Implement method overriding and


demonstrate dynamic method dispatch.

9.
Create and implement interfaces for multiple
inheritance and define default methods

10. Implement exception handling using try, catch,


and finally blocks for different scenarios.

11. Develop a multithreaded application by


extending Thread class to perform concurrent
tasks.

1|P a ge
Java Programming (DI03032021)

12. Develop a program to demonstrate String class


methods and string manipulation operations.

13. Implement a program using ArrayList and


LinkedList to demonstrate List interface
capabilities.

14.
Develop a program to read, write, and
manipulate text files using file streams

15.
Implement object serialization to save and
retrieve object states from files.

2|P a ge
Java Programming (DI03032021)

Date: ……………
Practical No: 1: Install JDK, write a simple "Hello World" program, compile, and
execute using Java compiler and interpreter.

A. Objective:

Print “Hello World” on console

B. Expected Program Outcomes (POs):


a. PO1: Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the
engineering problems.
b. PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering
tools and appropriate technique to conduct standard tests and measurements.
c. PO7: Life-long learning: Ability to analyze individual needs and engage in updating in
the context of technological changes in field of engineering.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
A. "Develop Applications using Java".
a. Set up Java Environment for executing Java programs.
b. Execute simple program by setting path variable.
B. Setup a java programming development environment.
a. Using Command prompt
b. Using IDEs.

D. Expected Course Outcomes(Cos)


a. CO1: Write simple java programs for a given problem statement.

E. Practical Outcome(PRo)

Install JDK, write a simple “Hello World” or similar java program, compilation,
debugging, executing using java compiler and interpreter.

F. Expected Affective domain Outcome (ADos)


1. Follow coding standards.
2. Demonstrate working as a leader/ a team member.
3. Follow ethical practices.

G. Prerequisite Theory:

● JDK Installation
● Java compiler Path configuration
● Install Text Editor

3|P a ge
Java Programming (DI03032021)

Setup for Windows

To install Java on Windows:

1. Go to "System Properties" (Can be found on Control Panel > System and Security >
System > Advanced System Settings)
2. Click on the "Environment variables" button under the "Advanced" tab
3. Then, select the "Path" variable in System variables and click on the "Edit" button
4. Click on the "New" button and add the path where Java is installed, followed by \bin. By
default, Java is installed in C:\Program Files\Java\jdk-11.0.1 (If nothing else was specified
when you installed it). In that case, You will have to add a new path with: C:\Program
Files\Java\jdk-11.0.1\bin
Then, click "OK", and save the settings
5. At last, open Command Prompt ([Link]) and type java -version to see if Java is running
on your machine

Step 1

Step 2

4|Page
Java Programming (DI03032021)

Step 3

Step 4

5|Page
Java Programming (DI03032021)

Step 5

Write the following in the command line ([Link]):

C:\Users\Your Name>java -version

If Java was successfully installed, you will see something like this (depending on version):

java version "11.0.1" 2018-10-16 LTS


Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS,
mixed mode)

[Link]:-
public class Main {
public static void main(String[] args) {
[Link]("Hello World");
}
}
Save the code in Notepad as "[Link]". Open Command Prompt ([Link]),
navigate to the directory where you saved your file, and type
C:\Users\Your Name>javac [Link]
C:\Users\Your Name>java Main

H. Resources/Equipment Required
Sr. Instrument/Equipment Specification Quantit
No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM As


mm1mum 2 GB and onwards per
batch
2 Software: Operating System Windows/ Linux size

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

6|P a ge
Java Programming (DI03032021)

I. Safety and necessary Precautions followed


● Make sure to install either 32bit or 64bit version of jdk based on your operating
system.

J. Procedure to be followed/Source code:

………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………..…
……………………………………………………………………………………………………………………………..……
…………………………………………………………………………………………………………………………..………
………………………………………………………………………………………………………………………..…………
……………………………………………………………………………………………………………………..……………
…………………………………………………………………………………………………………………..………………
………………………………………………………………………………………………………………..…………………
……………………………………………………………………………………………………………..……………………
…………………………………………………………………………………………………………..………………………
………………………………………………………………………………………………………..…………………………
……………………………………………………………………………………………………..……………………………
…………………………………………………………………………………………………..………………………………
………………………………………………………………………………………………..…………………………………
……………………………………………………………………………………………..……………………………………
…………………………………………………………………………………………..………………………………………
………………………………………………………………………………………..…………………………………………
……………………………………………………………………………………..……………………………………………
…………………………………………………………………………………..………………………………………………
………………………………………………………………………………..…………………………………………………
……………………………………………………………………………..……………………………………………………
…………………………………………………………………………..………………………………………………………
………………………………………………………………………..…………………………………………………………
……………………………………………………………………..……………………………………………………………
…………………………………………………………………..………………………………………………………………
………………………………………………………………..…………………………………………………………………
……………………………………………………………..……………………………………………………………………
…………………………………………………………..………………………………………………………………………
………………………………………………………..…………………………………………………………………………
……………………………………………………..……………………………………………………………………………
…………………………………………………..………………………………………………………………………………
………………………………………………..…………………………………………………………………………………
……………………………………………..……………………………………………………………………………………
…………………………………………..………………………………………………………………………………………

7|P a ge
Java Programming (DI03032021)

………………………………………..…………………………………………………………………………………………
……………………………………..……………………………………………………………………………………………
……………………………………..……………………………………………………………………………………………
……………………………………..……………………………………………………………………………………………
……………………………………..……………………………………………………………………………………………
……………………………………..……………………………………………………………………………………………

K. Input-Output :

L. Practical related Quiz.

1. What is JDK and why is it needed in Java?


2. Which commands are used to compile and run a Java program?
3. What is the difference between a compiler and an interpreter?

M. References / Suggestions ( lab manual designer should give)


1. [Link]

8|P a ge
Java Programming (DI03032021)

2. [Link]
3. [Link]
4. [Link]
N. Assessment-Rubrics
Performance Indicators Weightage
Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

9|P a ge
Java Programming (DI03032021)

Date: ……………
Practical No: 2: Write a Java program to implement basic arithmetic operations and
Demonstrate type casting

A. Objective:

Write a Java program to implement basic arithmetic operations and demonstrate


type casting

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyze well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java Control structure".

D. Expected Course Outcomes (Cos)

CO1: Write simple java programs for a given problem statement.

E. Practical Outcome (PRo)

Write a Java program to implement basic arithmetic operations and


Demonstrate type casting

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

10 | P a g e
Java Programming (DI03032021)

Java supports arithmetic operations like addition, subtraction, multiplication, division, and
modulus. These operations are performed using operators on variables. Type casting converts a

value from one data type to another, either implicitly or explicitly. It ensures compatibility and
precision in operations. This concept is important in mathematical and real-world applications.

Arithmetic operators in Java can be used with different data types like integers, floats, and
doubles. When two different data types are used, implicit type casting often occurs to avoid data
loss. This process is known as type promotion. Java ensures precise results by following a strict
type conversion system.

Explicit type casting is also possible by manually converting one data type into another. For
example, converting a double to an integer helps when only whole numbers are needed. Such
operations are common in financial calculations, scientific applications, and games.
Understanding casting makes programs more accurate and efficient.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………

11 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
12 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

13 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is type casting in Java?


2. List any two arithmetic operators in Java.
3. Give one example of explicit type casting.

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

14 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 3: Create a class to represent a Student with appropriate attributes and methods, then
instantiate and manipulate Student objects

A. Objective:

Create a class to represent a Student with appropriate attributes and methods, then instantiate
and manipulate Student objects

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java Control structure".

D. Expected Course Outcomes (Cos)

CO1: Write simple java programs for a given problem statement.

E. Practical Outcome (PRo)

Create a class to represent a Student with appropriate attributes and methods, then instantiate
and manipulate Student objects

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

A class in Java defines attributes and behaviors of an entity. A Student class may include
attributes like name, roll number, and age along with methods to display or update them. Objects
15 | P a g e
Java Programming (DI03032021)

are created from the class to represent real-world entities. This demonstrates the concept of
object-oriented programming. It provides reusability and better data organization.

A Student class is an example of encapsulation, where attributes and methods are grouped
together. Encapsulation helps in controlling access to data using access modifiers. It keeps
information secure and prevents misuse. This concept is central to object-oriented design.

The use of objects also encourages modularity. Multiple student objects can be created and
managed independently within the same program. Each object holds its own set of data,
representing different students. This way, Java programs can simulate real-world systems like
school databases.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………

16 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
17 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

18 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is the difference between a class and an object?


2. What are attributes and methods in a class?
3. What does instantiating an object mean?

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

19 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 4: Create a program that demonstrates the use of constructors and 'this' keyword.

A. Objective:

Create a program that demonstrates the use of constructors and 'this' keyword.

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java Control structure".

D. Expected Course Outcomes (Cos)

CO1: Write simple java programs for a given problem statement.

E. Practical Outcome (PRo)

Create a program that demonstrates the use of constructors and 'this' keyword.

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

Constructors are special methods used to initialize objects when they are created. They may
accept parameters to assign values to variables at the time of object creation. The this keyword
refers to the current object and helps to differentiate between instance variables and parameters. It
also allows chaining of constructors. This ensures clarity and avoids ambiguity in code.

20 | P a g e
Java Programming (DI03032021)

Constructors can be overloaded, meaning multiple constructors with different parameter lists can
exist in the same class. This allows flexibility when creating objects with varying initial data. For
example, one constructor may assign default values, while another accepts parameters. Such a
design makes object initialization more versatile.

The this keyword is also used to call one constructor from another within the same class. This
avoids duplication of initialization code and improves readability. It also passes the current object
reference as an argument to other methods. Using this ensures better structure and consistency
in object handling.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
21 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
22 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

23 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is a constructor in Java?


2. Difference between default and parameterized constructor?
3. What is the use of the this keyword?

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

24 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 5: Develop a program to demonstrate method overloading for different operations.

A. Objective:

Develop a program to demonstrate method overloading for different operations.

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java Control structure".

D. Expected Course Outcomes (Cos)

CO1: Write simple java programs for a given problem statement.

E. Practical Outcome (PRo)

Develop a program to demonstrate method overloading for different operations.

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

Method overloading allows a class to have multiple methods with the same name but different
parameter lists. This provides flexibility to perform similar tasks with different input data. It
improves program readability and supports compile-time polymorphism. Overloading is widely
25 | P a g e
Java Programming (DI03032021)

used in mathematical operations and utility methods. It is an important feature of Java for
reusability.

Method overloading is an example of compile-time polymorphism. It allows a single method


name to serve multiple purposes depending on arguments. The return type alone cannot
differentiate methods, but parameters can. This makes programming more intuitive and less
confusing.

Overloading also improves program maintainability. If a new type of input needs to be supported, a new
method can be added without disturbing existing ones. This reduces errors and enhances flexibility. It is
commonly applied in libraries and utility classes for maximum usability

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
26 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………

27 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

28 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is method overloading in Java?


2. Can changing the return type alone overload a method?
3. Difference between method overloading and overriding?

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date


29 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 6: Implement a class with static methods, variables, and blocks, then demonstrate their
behaviour.

A. Objective:

Implement a class with static methods, variables, and blocks, then demonstrate their behaviour.

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

 PO6: Project Management: Use engineering management principles individually, as


a team member or a leader to manage projects and effectively communicate about
well-defined engineering activities.

 PO7: Life-long learning: Ability to analyze individual needs and engage in updating in
the context of technological changes in field of engineering.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java object-oriented concepts".

D. Expected Course Outcomes (Cos)

CO2: Use object oriented programming concepts to solve real world problems.

E. Practical Outcome (PRo)

Implement a class with static methods, variables, and blocks, then demonstrate
their behaviour.

30 | P a g e
Java Programming (DI03032021)

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

Static members belong to the class rather than individual objects. Static variables are shared
among all objects, ensuring common data storage. Static methods can be called without creating
an object. Static blocks are executed once when the class is loaded into memory. This helps in
initializing resources efficiently.

Static members are useful for representing information common to all objects of a class. For
example, a static counter can keep track of how many objects are created. This ensures
consistency without requiring multiple copies of the variable. Static methods are often used for
utility functions.

Static blocks are executed before the main method and are helpful for one-time setup. They can
initialize configuration files, constants, or resources. Since they run automatically, no explicit call
is needed. This makes programs more efficient and structured.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………

31 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
32 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

33 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is a static variable?


2. When does a static block execute?
3. Can a static method be called without creating an object?

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

34 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 7: Create a program to demonstrate single, multilevel, and hierarchical inheritance.

A. Objective:

Create a program to demonstrate single, multilevel, and hierarchical inheritance.

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 " Develop Applications using Java object-oriented concepts ".

D. Expected Course Outcomes (Cos)

CO2: Use object oriented programming concepts to solve real world problems.

E. Practical Outcome (PRo)

Create a program to demonstrate single, multilevel, and hierarchical inheritance.

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

Inheritance is the process of deriving a new class from an existing one. The new class, called a
subclass, acquires properties and behaviors of the parent class. Java supports single, multilevel,
and hierarchical inheritance. This promotes reusability and establishes relationships between
classes. It also helps in implementing real-world models in programming.

35 | P a g e
Java Programming (DI03032021)

Inheritance also allows for reusability of code by extending existing classes. It avoids writing
duplicate code for related functionalities. Subclasses can add new features while keeping
inherited behavior intact. This reduces complexity in program design.

Another advantage of inheritance is flexibility in building hierarchies. For example, a Vehicle


class can serve as a parent, while Car and Bike become subclasses. This mirrors real-world
relationships. It helps in understanding and modeling systems effectively.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………

36 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
37 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………

38 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………

K. Input-Output:

L. Practical related Quiz.

1. What is inheritance in Java?


2. Define Single and multilevel inheritance.
3. What is hierarchical inheritance?

M. References / Suggestions
 [Link]
 [Link]


39 | P a g e
Java Programming (DI03032021)


N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

40 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 8: Implement method overriding and demonstrate dynamic method dispatch.

A. Objective:

Implement method overriding and demonstrate dynamic method dispatch.

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 " Develop Applications using Java object-oriented concepts".

D. Expected Course Outcomes (Cos)

CO2: Use object oriented programming concepts to solve real world problems.

E. Practical Outcome (PRo)

Implement method overriding and demonstrate dynamic method dispatch.

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

Method overriding occurs when a subclass provides a specific implementation of a method


already defined in its parent class. This enables runtime polymorphism where the method call is
decided at execution time. Dynamic method dispatch ensures that the correct version of the

41 | P a g e
Java Programming (DI03032021)

method is executed based on the object type. It allows flexibility in extending existing behavior.
This is useful in designing frameworks and libraries.

Dynamic method dispatch is also known as runtime polymorphism. It ensures that the method
associated with the object type is executed, not the reference type. This is crucial when working
with references of parent classes pointing to child objects. It provides a flexible framework for
design.

Overriding also supports extensibility in programming. When new behavior is needed, subclasses
can redefine methods without changing existing code. This follows the principle of open for
extension, closed for modification. Such a practice is widely used in software development
frameworks.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
42 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
43 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

44 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is method overriding?


2. What is dynamic method dispatch in Java?
3. Difference between method overloading and overriding?

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

45 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 9: Create and implement interfaces for multiple inheritance and define default methods

A. Objective:

Create and implement interfaces for multiple inheritance and define default methods.

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java object-oriented concepts".

D. Expected Course Outcomes (Cos)

CO2: Use object oriented programming concepts to solve real world problems.

E. Practical Outcome (PRo)

Create and implement interfaces for multiple inheritance and define default methods.

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

Interfaces in Java define abstract methods that must be implemented by classes. They provide a
way to achieve multiple inheritance and standardize behavior across different classes. From Java
8 onwards, interfaces can also contain default methods with implementations.

This allows backward compatibility and code reusability. Interfaces are widely used in
46 | P a g e
Java Programming (DI03032021)

application frameworks and APIs.

Interfaces are considered a contract between classes. Any class that implements an interface
agrees to provide definitions for its methods. This ensures uniformity in behavior across different
classes. It also supports abstraction by hiding implementation details.

Default methods reduce the burden of updating all implementing classes when new features are
introduced. They allow backward compatibility without breaking older code. Interfaces combined
with default methods offer both flexibility and standardization. This balance is valuable in
modern Java programming.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
47 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
48 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

49 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is an interface in Java?


2. How does Java achieve multiple inheritance using interfaces?
3. What are default methods in an interface?

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

50 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 10: Implement exception handling using try, catch, and finally blocks for different
scenarios.

A. Objective:

Implement exception handling using try, catch, and finally blocks for different scenarios.

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java object-oriented concepts".

D. Expected Course Outcomes (Cos)

CO2: Use object oriented programming concepts to solve real world problems.

E. Practical Outcome (PRo)

Implement exception handling using try, catch, and finally blocks for different scenarios.

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

Exceptions are runtime errors that disrupt normal program flow. Java provides mechanisms like
try, catch, and finally blocks to handle such situations. Exception handling ensures smooth

51 | P a g e
Java Programming (DI03032021)

execution by catching and resolving errors. It improves reliability and prevents program crashes.
Handling exceptions properly is an important aspect of secure coding.

Unchecked exceptions, such as runtime errors, occur due to invalid user inputs or logical
mistakes. Checked exceptions, on the other hand, must be handled explicitly by the programmer.
This distinction helps in writing safe and reliable programs. Exception handling ensures that
errors do not cause abrupt termination.

The finally block is used to close resources like files or database connections. It always
executes, regardless of whether an exception occurs. This ensures proper cleanup and resource
management. Exception handling thus plays a vital role in building secure applications.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
52 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
53 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

54 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is exception handling in Java?


2. Difference between checked and unchecked exceptions?
3. What is the role of the finally block?

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

55 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 11: Develop a multithreaded application by extending Thread class to perform
concurrent tasks.

A. Objective:

Develop a multithreaded application by extending Thread class to perform concurrent tasks.

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

 PO6: Project Management: Use engineering management principles individually, as


a team member or a leader to manage projects and effectively communicate about
well-defined engineering activities.

 PO7: Life-long learning: Ability to analyze individual needs and engage in updating in
the context of technological changes in field of engineering.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java object-oriented concepts”.

D. Expected Course Outcomes (Cos)

CO2: Use object oriented programming concepts to solve real world problems.

E. Practical Outcome (PRo)

Develop a multithreaded application by extending Thread class to perform concurrent tasks.

56 | P a g e
Java Programming (DI03032021)

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

Multithreading is a feature that allows multiple tasks to run simultaneously within a program.
Each thread is an independent path of execution. Java provides the Thread class to create and
manage threads. This improves CPU utilization and program performance. Multithreading is
useful in gaming, animation, and server-based applications.

Multithreading provides concurrency, where multiple tasks progress at the same time. This is
different from parallelism, where tasks run truly simultaneously on multiple processors. Java’s
thread model provides synchronization to avoid conflicts between threads. This prevents issues
like data inconsistency.

Threads can have different priorities that affect their scheduling. High-priority threads may
execute before lower-priority ones. Thread lifecycle includes states like new, runnable, waiting,
and terminated. Understanding these states helps in better thread management.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
57 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
58 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

59 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is multithreading?
2. How do you create a thread using the Thread class?
3. What is the difference between start() and run() methods?

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

60 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 12: Develop a program to demonstrate String class methods and string manipulation
operations.

A. Objective:

Develop a program to demonstrate String class methods and string manipulation operations.

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java object-oriented concepts".

D. Expected Course Outcomes (Cos)

CO2: Use object oriented programming concepts to solve real world problems.

E. Practical Outcome (PRo)

Develop a program to demonstrate String class methods and string manipulation operations.

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

Strings are sequences of characters and are widely used in Java applications. The String class
provides many methods to manipulate and process text. Common operations include
concatenation, substring extraction, comparison, and case conversion.

Strings are immutable, meaning their content cannot be changed once created. Efficient handling
61 | P a g e
Java Programming (DI03032021)

of strings is essential for text-based applications.

Strings support methods like equals(), compareTo(), and substring() for comparing and
extracting parts of text. They also allow searching and replacing characters or words. These
functions make it easy to handle user input or file data. They are highly versatile for applications.

Since strings are immutable, every modification creates a new object. This ensures thread safety
and consistency in data handling. However, for frequent changes, classes like StringBuilder
and StringBuffer are used. They allow mutable operations with better performance.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………

62 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
63 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

64 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is the difference between == and .equals() for strings?


2. Name any two methods of the String class.
3. What is string concatenation?

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

65 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 13: Implement a program using ArrayList and LinkedList to demonstrate List interface
capabilities.

A. Objective:

Implement a program using ArrayList and LinkedList to demonstrate List interface capabilities.

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java object-oriented concepts".

D. Expected Course Outcomes (Cos)

CO2: Use object oriented programming concepts to solve real world problems.

E. Practical Outcome (PRo)

Implement a program using ArrayList and LinkedList to demonstrate List interface capabilities.

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

ArrayList and LinkedList are implementations of the List interface in Java. They allow
dynamic storage of elements and provide flexible data handling. An ArrayList is efficient for
accessing elements, while a LinkedList is better for frequent insertions and deletions. Both
support generic types and can grow in size dynamically. These collections are widely used in
real-world applications.
66 | P a g e
Java Programming (DI03032021)

ArrayLists store elements in a dynamic array, providing fast random access. However, insertions
and deletions in the middle are slower due to shifting of elements. LinkedLists store elements as
nodes connected with references. They are faster for frequent modifications.

Both ArrayList and LinkedList implement the List interface and support iteration. They provide
methods for adding, removing, and accessing elements efficiently. Their choice depends on the
type of operation required. This makes them flexible for different scenarios.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
67 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
68 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

69 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is the difference between ArrayList and LinkedList?


2. Which package contains ArrayList and LinkedList classes?
3. How do you add an element to an ArrayList?

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

70 | P a g e
Java Programming (DI03032021)

Date: ……………
Practical No: 14: Develop a program to read, write, and manipulate text files using file streams

A. Objective:

Develop a program to read, write, and manipulate text files using file streams

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java Inheritance".

D. Expected Course Outcomes (Cos)

CO3: Develop an object-oriented program using inheritance and package concepts for a
given problem statement.

E. Practical Outcome (PRo)

Develop a program to read, write, and manipulate text files using file streams

F. Expected Affective domain Outcome (ADos)


 Follow coding standards.
 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

File streams in Java allow reading from and writing to files. They provide a way to handle
external data storage. Character streams and byte streams are two categories used for different
data types. File handling is essential for storing and retrieving user data. This makes applications
more interactive and persistent.

71 | P a g e
Java Programming (DI03032021)

File streams are divided into byte streams and character streams. Byte streams handle binary data
like images, while character streams handle text files. Java provides classes like
FileInputStream and FileReader for this purpose. They ensure efficient data transfer between
programs and storage.

Files can also be opened in read or write modes as required. Proper file handling prevents data
loss and corruption. Applications like text editors, log systems, and databases use file streams.
This makes file I/O a fundamental part of Java.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………

72 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
73 | P a g e
Java Programming (DI03032021)

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

74 | P a g e
Java Programming (DI03032021)

L. Practical related Quiz.

1. What is a file stream in Java?


2. Difference between FileReader and FileWriter?
3. What is the purpose of BufferedReader class?

M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

75 | P a g e
Date: ……………
Practical No: 15: Implement object serialization to save and retrieve object states from files.

A. Objective:

Implement object serialization to save and retrieve object states from files.

B. Expected Program Outcomes (POs):

 PO1: Basic and Discipline specific knowledge: Apply knowledge of basic


mathematics, science and engineering fundamentals and engineering specialization
to solve the engineering problems.

 PO2: Problem analysis: Identify and analyse well-defined engineering problems using
codified standard methods.

 PO3: Design/ development of solutions: Design solutions for engineering well-


defined technical problems and assist with the design of systems components or
processes to meet specified needs.

 PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering


tools and appropriate technique to conduct standard tests and measurements.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills:
 "Develop Applications using Java Inheritance".

D. Expected Course Outcomes (Cos)

CO3: Develop an object-oriented program using inheritance and package concepts for a
given problem statement.

E. Practical Outcome (PRo)

Implement object serialization to save and retrieve object states from files.

F. Expected Affective domain Outcome (ADos)

 Follow coding standards.


 Demonstrate working as a leader/ a team member.
 Follow ethical practices.

G. Prerequisite Theory:

Serialization is the process of converting an object into a byte stream for storage or transfer. It
allows saving the state of an object in a file or sending it over a network. Deserialization is the
reverse process of reconstructing the object. This feature is widely used in distributed systems
and databases. It provides a way to maintain data consistency across platforms.
Serialization supports portability by enabling objects to be shared across different machines. It is
often used in network programming and web services. The serialized form of an object can be
transmitted easily between client and server. This helps in building distributed systems.

Serialized data can also be stored in files for later use. When deserialized, objects retain their
original state and behavior. This feature is useful for saving user preferences or application
settings. Serialization ensures both persistence and transportability of data.

H. Resources/Equipment Required

Sr. Instrument/Equipment Specification Quantit


No.
/Components/Trainer kit y

1 Hardware: Computer System Computer (i3-i5 preferable),RAM Asper


mm1mum 2 GB and onwards batch
size
2 Software: Operating System Windows/ Linux

3 Software Jdk 1.8.0 or above, Notepad++ or other


text editor

I. Safety and necessary Precautions followed.


● Shutdown computer system properly once the Lab hours are finished.

J. Procedure to be followed/Source code:

…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………
………………………………………………………..…..…………………………………………………………………………………
……………………………………………..

K. Input-Output:

L. Practical related Quiz.

1. What is serialization in Java?


2. Which interface is used for serialization?
M. References / Suggestions
 [Link]
 [Link]

N. Assessment-Rubrics

Performance Indicators Weightage


Process related (15 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (10 Marks) 30%
4. Expected output 10%
5. Timely Submission of report 10%

6. Answer to sample questions 10%


Total (25 Marks) 100%

Sign with Date

You might also like