Question 1: Basic Syntax and Data Structures
Problem Statement: Write a Java program to find the second largest number in an array of
integers.
Requirements:
The program should handle arrays of different lengths, including edge cases like
arrays with less than two elements.
Optimize the program to run in O(n) time complexity.
___________________________________________________________________
Question 2: Object-Oriented Programming
Problem Statement: Design a class called Library Book to represent a book in a library
system. The class should have the following features:
Private attributes for the book's title, author, and ISBN.
A constructor to initialize these attributes.
Public getter methods for each attribute.
A method called display Info that prints out the book's details in a user-friendly
format.
_____________________________________________________________________
Question 3: Exception Handling
Problem Statement: Write a method called divide that takes two integers and returns their
quotient. If the divisor is zero, the method should throw an Illegal Argument Exception
with an appropriate error message.