OOP Assignment Questions-AIML 16.7.24
OOP Assignment Questions-AIML 16.7.24
ASSIGNMENT QUESTIONS
1
4. Write a Java program to create a class called Shape
with methods called getPerimeter() and getArea().
Create a subclass called Circle that overrides the
getPerimeter() and getArea() methods to calculate the
area and perimeter of a circle.
5. What is Inheritance ? Explain its hierarchy.
1. Rules for naming 1. Write a Java program to show that an abstract class
variables can contain concrete methods along with abstract
2. Local and Instance methods
variable 2. Write a Java program to show that an abstract class
3. Conversion of one can contain concrete methods along with abstract
4 data type to methods
another data type 3. Write a Java program to demonstrate an abstract class
4. Variable having variables and methods.
shadowing 4. Create a Java program to demonstrate multiple levels
5. Comparison of of inheritance with abstract classes
while and do while 5. Write the advantages of abstract classes.
5 1. Modularity 1. How do you define methods in an interface?
2. Reusability 2. Write a Java program to create an interface Sortable
3. Significance of with a method sort() that sorts an array of integers in
protected access in ascending order. Create two classes BubbleSort and
inheritance SelectionSort that implement the Sortable interface
4. Usage of access and provide their own implementations of the sort()
specifiers in method.
object oriented 3. Write a Java program to create an interface Playable
programming with a method play() that takes no arguments and
Features of returns void. Create three classes Football, Volleyball,
encapsulation and Basketball that implement the Playable interface
5. Applications of and override the play() method to play the respective
OOP sports.
4. Write a Java program to create an interface Searchable
with a method search(String keyword) that searches
for a given keyword in a text document. Create two
classes Document and WebPage that implement the
2
Searchable interface and provide their own
implementations of the search() method
5. Write a Java program to create an interface Sortable
with a method sort (int[] array) that sorts an array of
integers in descending order. Create two classes
QuickSort and MergeSort that implement the Sortable
interface and provide their own implementations of the
sort() method.
Prepared by Approved by
Dr.S.J.Subhashini Dr.C.Callins Christiyana
Asso.Prof /CSE Prof & HoD /CSE