Lab Plan D9A 15-16
Lab Plan D9A 15-16
Course Outcomes: After completion of this course students will be able to:
1. Students will be able to code a program using JAVA constructs.
2. Given an algorithm a student will be able to formulate a program that correctly
implements the algorithm.
3. Students will be able to generate different patterns and flows using control
structures and use recursion in their programs.
4. Students will be able to use thread methods, thread exceptions and thread priority.
5. Students will implement method overloading in their code.
6. Students will be able to demonstrate reusability with the help of inheritance.
7. Students will be able to make more efficient programs.
LIST OF EXPRIMENTS
Sr.no.
1
2
3
Experiments to be conducted
Mapped
CO
1, 2, 3, 5,
7
1, 2, 3, 7
Function Overloading
Create a Point class to represent a point in two dimensional
space, with attributes as x and the y coordinate. Include
1, 2, 3, 5,
methods to read point corrdinates, display coordinate
7
details, to displace a point by x axis or y axis or both x and y
axis.
1, 2, 3, 7
1, 2, 3, 7
10
11
12
Inheritance
Create a 2DPoint class to represent a point in two
dimensional space, with attributes as x and the y
coordinate. Include methods to read point corrdinates,
display coordinate details, to displace a point by x axis or y
axis or both x and y axis. Implement another class 3Dpoint
that represents a point in 3 dimensional space, by reusing
the 2DPoint class. Include appropriate methods.
Abstract class and Runtime Polymorphism
Create an class shape for shapes with one dimension ( eg:
square and circle)with attributes as dimension and colour.
And methods to find colour, find dimensions and an
absrtact method to find area. Let class Square and Circle
inherit the Shape class and implement the method to
calculate area.
Interface
Create an Interface Shape with function to read, display,
calculate area and constant variable for value of PI. Let two
classes Rectangle and Circle implement the interface.
Packages
Create a package TestPack with class Point definition. Write
a program to create objects of Point by importing the
package. And display their area.
Multithreading
Write a program to create two threads one to print the even
numbers and other odd number. And execute them
together.
1, 2, 3, 6,
7
1, 2, 3, 7
1, 2, 3, 7
1, 2, 3, 7
1, 2, 3, 4,
7
13
Applet
Write an applet to display the following figure.
1, 2, 3, 7
Performance of
experiment
Explanation
Presentation of Ouptut