Lab Assignment - JAVA - CS594A
Lab Assignment - JAVA - CS594A
Java Programs to –
Week – 1:
Week – 2:
Week – 3:
Week – 4:
1) Design a class Volume and then find out the volume of a Cube, Cylinder and Sphere using
method overloading.
2) Implement the above program using constructor overloading.
3) Implement i) call by value and ii) call by reference.
4) show the application of recursion.
Week – 5:
Week – 6:
Week – 7:
Week – 8:
Week – 9:
1) Define an interface called Area. Create two classes Rectangle and Circle that implement the
interface. Find out the area of Rectangle and Triangle.
2) show the implementation of Multiple Inheritance.
Week – 10:
1) create two user-defined packages pkg1 and pkg2 and importing both to another program which
is outside the packages.
2) create multiple packages containing classes with identical names.
3) show how a protected variable of one package can be accessed in a subclass in another package.
4) show how to add multiple public classes to a single package.
Week – 11:
Week – 12:
1) to create 3 threads - the 1st thread to display GOOD MORNING for every 1 second, the 2nd
thread to display HELLO for every 2 seconds and the 3rd thread to display WELCOME for
every 3 seconds.
2) to implement the above program by assigning priorities to the created threads such that the 1st
thread executes first followed by the 2nd thread and lastly the 3rd thread.
Week – 13: