SWARNIM STARTUP & INNOVATION UNIVERSITY
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING
OBJECT ORIENTED PROGRAMMING WITH JAVA
B.TECH: 5TH SEMESTER
Assignment: 2
1. Explain the concept of recursion with an example. What are its
advantages and disadvantages?
2. What is a palindrome? Give two examples of palindrome strings and
explain how to check them.
3. Define a prime number. How can you check whether a given
number is prime or not?
4. Differentiate between iteration and recursion using the example of
Fibonacci series generation.
5. Define a class and an object with reference to the Bank Account
example. What are the advantages of OOP?
6. How is average and grade calculation performed in student marks
evaluation? What are the possible grading criteria?
7. What is exception handling? Why is it important? Explain with the
case of division by zero.
8. What are the benefits of inheritance in Java? Explain with examples.
9. Differentiate between a Superclass (Base Class) and a Subclass
(Child Class) with an example.
10. Explain the use of the extends keyword in Java. Write the syntax of
single inheritance.
11. What is single level inheritance? Illustrate it with a Java example.
12. Define multi-level inheritance with an example. How does it differ
from single inheritance?
13. What is hierarchical inheritance? Explain with a neat diagram.
14. Why does Java not support multiple inheritance with classes? How
does it achieve multiple inheritance using interfaces.
15. Define hybrid inheritance. How is it formed in Java?
16. Explain the difference between multiple inheritance and hybrid
inheritance with examples.