This document contains 18 programming tasks related to object oriented programming concepts for students. The tasks cover topics like inheritance, polymorphism, abstraction, exception handling, file I/O, threads, GUI components.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
30 views2 pages
OOP Worksheet
This document contains 18 programming tasks related to object oriented programming concepts for students. The tasks cover topics like inheritance, polymorphism, abstraction, exception handling, file I/O, threads, GUI components.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Adama Science and Technology University
School of Electrical Engineering and Computing
Department of Computer Science and Engineering
Object Oriented Programming [Seng 2202] Worksheet
Target Group: Software Engineering 2nd Year Students 1. Write a program to give example for multiple inheritance in Java. 2. Write a program to give the example for method overloading and overriding concepts. 3. Write a program to give the example for ‘super’ keyword 4. Write a program to create and implement an abstract class. 5. Write a program to create an interface Arithmetic, in this interface we have two methods add and product. Implements this interface in another class named ArithmeticImpl. 6. Create class Box and Box2. Box2 is extended class of Box. The above two classes going to pull fill following requirement: Include constructor. set value of length, breadth, height Find out area and volume. Note: Base class and sub classes have respective methods and instance variables. 7. Write a program to check whether the given array size is negative or not using try and catch block. 8. Write a program for creation of user defined exception. 9. Write a program to create a file and write data into it using the methods of OutputStream class. 10. Write a program to create a file in the path c:\MyFile\testfile.txt and check whether that file is exists using the command exists (), isDirectory (), isFile (), getName () and getAbsolutePath (). 11. Write a program to accept specified number of characters as input and converts them into uppercase characters and then store them to a file named “UpperCase.txt” using Reader and Writer file. 12. 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 400 milliseconds). 13. Create a multithreaded program by creating a subclass of Thread and then creating, initializing, and staring two Thread objects from your class. The threads will execute concurrently and display “Java concurrency is cool “ to the console window. 14. Write a program to show how synchronized methods and objects monitors are used to coordinate access to a shared object by multiple threads. 15. Write a program that will display check boxes and option buttons numbered from 1 to 5. Use a textbox to display the number of those corresponding boxes or button checked. 16. Write a program to create a dialogbox and menu. 17. Write a program to create a canvas. 18. Write a program to create a simple calculator.