Programming Experiments -OOP in Java
Programming Experiments -OOP in Java
1. Develop a JAVA program to add TWO matrices of suitable order N (The value of
N should be read from command line arguments).
3. A class called Employee, which models an employee with an ID, name and
salary, is designed as shown in the following class diagram.
The method raiseSalary (percent) increases the salary by the given percentage.
Develop the Employee class and suitable main method for demonstration.
5. Develop a JAVA program to create a class named shape. Create three sub
classes namely: circle, triangle and square, each class has two member functions
named draw () and erase (). Demonstrate polymorphism concepts by developing
suitable methods, defining member data and main program.
10. Develop a JAVA program to create a package named mypack and import &
implement it in a suitable class.
11. Write a program to illustrate creation of threads using runnable class. (start
method start each of the newly created thread. Inside the run method there is
sleep() for suspend the thread for 500 milliseconds).
12. Develop a program to create a class MyThread in this class a constructor, call
the base class constructor, using super and start the thread. The run method of
the class starts after this. It can be observed that both main thread and created
child thread are executed concurrently.