0% found this document useful (0 votes)
6 views1 page

Java Assignment 2

The document is an assignment for a B.Tech 5th semester course in Object Oriented Programming with Java, covering various topics such as recursion, palindromes, prime numbers, iteration vs recursion, and exception handling. It includes questions on class and object definitions, inheritance types, and grading criteria in student evaluation. The assignment aims to assess students' understanding of fundamental programming concepts and their applications in Java.

Uploaded by

Joy Gaming
Copyright
© © All Rights Reserved
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% found this document useful (0 votes)
6 views1 page

Java Assignment 2

The document is an assignment for a B.Tech 5th semester course in Object Oriented Programming with Java, covering various topics such as recursion, palindromes, prime numbers, iteration vs recursion, and exception handling. It includes questions on class and object definitions, inheritance types, and grading criteria in student evaluation. The assignment aims to assess students' understanding of fundamental programming concepts and their applications in Java.

Uploaded by

Joy Gaming
Copyright
© © All Rights Reserved
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

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.

You might also like