Java Lab Lesson - Plan
Java Lab Lesson - Plan
Execution
Develop a JAVA program to add and
TWO matrices of suitable order N
1 (The value of N should be read
Explanation 20/08/2024
3
from command line arguments) on Eclipse
IDE
Develop a stack class to hold a Execution
maximum of 10 integers with and
2 suitable methods. Develop a JAVA 3 Explanation 27/08/2024
main method to illustrate Stack on Eclipse
operations. IDE
A class called Employee, which
models an employee with an ID,
name and salary, is designed as Execution
shown in the following class and
3
3 diagram. The method raiseSalary Explanation 03/09/2024
(percent) increases the salary by on Eclipse
the given percentage. Develop the IDE
Employee class and suitable main
method for demonstration.
4 A class called MyPoint, which Execution 10/09/2024
models a 2D point with x and y 3 and
coordinates, is designed as follows:
● Two instance variables x (int)
Explanation
and y (int). on Eclipse
● A default (or "no-arg") IDE
constructor that construct a point
at the default location of (0, 0).
● A overloaded constructor that
constructs a point with the given x
and y coordinates.
● A method setXY() to set both x
and y.
● A method getXY() which returns
the x and y in a 2-element int array.
● A toString() method that returns
a string description of the instance
in the format "(x, y)".
● A method called distance(int x,
int y) that returns the distance
from this point to another point at
the given (x, y) coordinates
● An overloaded distance(MyPoint
another) that returns the distance
from this point to the given
MyPoint instance (called another)
● Another overloaded distance()
method that returns the distance
from this point to the origin (0,0)
Develop the code for the class
MyPoint. Also develop a JAVA
program (called TestMyPoint) to
test all the methods defined in the
class.
Develop a JAVA program to create a
class named shape. Create three
sub classes namely: circle, triangle
and square, each class has two Execution
5 member functions named draw () and
and erase (). Demonstrate Explanation 17/09/2024
15.09.2023 14.09.2023 Annexure- 3
on Eclipse
II 3 3 polymorphism concepts by IDE
developing suitable methods,
defining member data and main
program.
Develop a JAVA program to create
an abstract class Shape with
abstract methods calculateArea() Execution
and calculatePerimeter(). Create and
6. subclasses Circle and Triangle that 3 Explanation 24/09/2024
extend the Shape class and on Eclipse
implement the respective methods IDE
to calculate the area and perimeter
of each shape
Develop a JAVA program to create
an interface Resizable with Execution
methods resizeWidth(int width) and
and resizeHeight(int height) that
7 allow an object to be resized.
3 Explanation 01/10/2024
Create a class Rectangle that on Eclipse
implements the Resizable interface IDE
and implements the resize methods
Develop a JAVA program to create Execution
an outer class with a function and
display. Create another class inside
8 the outer class named inner with a
3 Explanation 08/10/2024
function called display and call the on Eclipse
two functions in the main class. IDE
9 Develop a JAVA program to raise a 3 Execution 15/10/2024
custom exception (user defined and
exception) for DivisionByZero
Explanation
using try, catch, throw and
finally.excluding documents with on Eclipse
certain words and phrases. IDE
Execution
Develop a JAVA program to create a and
10 package named mypack and import 3 Explanation 22/10/2024
& implement it in a suitable class. on Eclipse
IDE
Write a program to illustrate
creation of threads using runnable Execution
class. (start method start each of and
11 the newly created thread. Inside 3 Explanation 05/11/2024
the run method there is sleep() for on Eclipse
suspend the thread for 500 IDE
milliseconds).
Develop a program to create a class
MyThread in this class a
constructor, call the base class Execution
constructor, using super and start and
12 the thread. The run method of the 3 Explanation 12/11/2024
class starts after this. It can be on Eclipse
observed that both main thread IDE
and created child thread are
executed concurrently.
13 Practice lab 3 19/11/2024
14 Test 1 3 26/11/2024
15 Practice Lab 03/12/2024
16 Test 2 10/12/2024
17 Practice Lab 17/12/2024
Textbook
1. Java: The Complete Reference, Twelfth Edition, by Herbert Schildt, November
2021, McGraw-Hill, ISBN: 9781260463422
2.
Reference Books
1. Programming with Java, 6th Edition, by E Balagurusamy, Mar-2019, McGraw Hill
Education, ISBN: 9789353162337.
2. Thinking in Java, Fourth Edition, by Bruce Eckel, Prentice Hall, 2006
(https://sd.blackball.lv/library/thinking_in_java_4th_edition.pdf)
Web links and Video Lectures (e-Resources):
● Java Tutorial: https://www.geeksforgeeks.org/java/
● Introduction To Programming In Java (by Evan Jones, Adam Marcus and Eugene
Wu): https://ocw.mit.edu/courses/6-092-introduction-to-programming-in-java-january-
iap-2010/
● Java Tutorial: https://www.w3schools.com/java/
● Java Tutorial: https://www.javatpoint.com/java-tutorial