0% found this document useful (0 votes)
4 views18 pages

Java Lab Manual

The document is a lab manual for a B Tech course in Computer Science & Engineering, specifically for the subject CS 406: Programming Practice in Java. It outlines 15 experiments, each with specific aims and algorithms, covering topics such as Java installation, basic programming, object-oriented concepts, exception handling, and data structures. Each experiment includes a space for students to write their code.

Uploaded by

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

Java Lab Manual

The document is a lab manual for a B Tech course in Computer Science & Engineering, specifically for the subject CS 406: Programming Practice in Java. It outlines 15 experiments, each with specific aims and algorithms, covering topics such as Java installation, basic programming, object-oriented concepts, exception handling, and data structures. Each experiment includes a space for students to write their code.

Uploaded by

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

ORIENTAL INSTITUTE OF SCIENCE & TECHNOLOGY

Department of Computer Science & Engineering

Lab Manual
Programming Practice(Java)

Course Name:B Tech


Subject Code:CS 406
Session :Jan Jun 2026

Submitted To Submitted By
[Link] Name of Experiment Date of Date of Signature
Completion Submission

10
11

12

13

14

15
Experiment 1: Installation & Setup of Java
AIM:
To install Java and run a simple Java program.

ALGORITHM:

1. Install JDK.
2. Set environment variables (JAVA_HOME, PATH).
3. Open command prompt.
4. Write a simple Java program.
5. Compile using javac.
6. Run using java.

SPACE FOR WRITING CODE:


Experiment 2: Basic Java Program (Hello World)
AIM:
To write and execute a simple Java program.

ALGORITHM:

1. Create a class.
2. Define main() method.
3. Use [Link]() to display output.
4. Compile and run.

SPACE FOR WRITING CODE:


Experiment 3: Class and Object
AIM:
To understand class and object in Java.

ALGORITHM:

1. Define a class.
2. Declare variables.
3. Create object in main method.
4. Access data using object.

SPACE FOR WRITING CODE:


Experiment 4: Constructor
AIM:
To demonstrate constructor in Java.

ALGORITHM:

1. Create a class.
2. Define constructor.
3. Initialize variables.
4. Create object to call constructor.

SPACE FOR WRITING CODE:


Experiment 5: Method Overloading (Compile-Time
Polymorphism)
AIM:
To implement method overloading.

ALGORITHM:

1. Create multiple methods with same name.


2. Change parameters.
3. Call methods using object.

SPACE FOR WRITING CODE:


Experiment 6: Inheritance
AIM:
To implement inheritance in Java.

ALGORITHM:

1. Create parent class.


2. Create child class using extends.
3. Access parent properties.
4. Call methods.

SPACE FOR WRITING CODE:


Experiment 7: Encapsulation
AIM:
To implement encapsulation using getters and setters.

ALGORITHM:

1. Declare variables as private.


2. Create getter and setter methods.
3. Access data using methods.

SPACE FOR WRITING CODE:


Experiment 8: Abstraction
AIM:
To implement abstraction using abstract class.

ALGORITHM:

1. Create abstract class.


2. Declare abstract method.
3. Extend class and define method.
4. Create object of subclass.

SPACE FOR WRITING CODE:


Experiment 9: Runtime Polymorphism (Method Overriding)
AIM:
To demonstrate method overriding.

ALGORITHM:

1. Create parent class.


2. Override method in child class.
3. Use parent reference.
4. Call method.

SPACE FOR WRITING CODE:


Experiment 10: Interface
AIM:
To implement interface in Java.

ALGORITHM:

1. Create interface.
2. Declare methods.
3. Implement interface in class.
4. Define methods.

SPACE FOR WRITING CODE:


Experiment 11: Exception Handling
AIM:
To handle exceptions using try-catch.

ALGORITHM:

1. Write code with possible error.


2. Use try block.
3. Catch exception.
4. Print message.

SPACE FOR WRITING CODE:


Experiment 12: Multithreading
AIM:
To create and run multiple threads.

ALGORITHM:

1. Create class extending Thread.


2. Override run() method.
3. Create thread object.
4. Call start() method.

SPACE FOR WRITING CODE:


Experiment 13: ArrayList
AIM:
To use ArrayList in Java.

ALGORITHM:

1. Import [Link].*.
2. Create ArrayList.
3. Add elements.
4. Display elements.

SPACE FOR WRITING CODE:


Experiment 14: List Interface
AIM:
To implement List interface.

ALGORITHM:

1. Import package.
2. Create List using ArrayList.
3. Add elements.
4. Traverse list.

SPACE FOR WRITING CODE:


Experiment 15: Set Interface
AIM:
To demonstrate Set interface.

ALGORITHM:

1. Import package.
2. Create Set using HashSet.
3. Add elements.
4. Display unique elements.

SPACE FOR WRITING CODE:

You might also like