Вы находитесь на странице: 1из 1

Lab Assignments: Core JAVA Day: 3

1. Write a program to demonstrate the difference between static & non-static variables. 2. Create an abstract class with name Player. The class should have play(), pause(), and stop() methods. Extend the class in another class named GenericPlayer. The GenericPlayer can play .avi and .dat files. Derive another class from GenericPlayer named DVDPlayer. This class can play .mpg file also. Create a reference variable of type Player. Objects may be either of type GenericPlayer or DVDPlayer. Try to understand dynamic polymorphism in this example. 3. Create a java program that has three version of add method which can add two, three, and four integers. 4. Create a class SimpleCalculator that has functionality of addition, substraction division, multiplication, square and squareroot and then create another class ScientificCalculator that has functionality of SimpleCalculator and some other functionality like sin, cos, tan, sin-1, cos-1, tan-1 .

Вам также может понравиться