Exception Handling and Parameterized Polymorphism

Consider a class Book with private instance variables title and author, and a parameterized constructor that takes two parameters t and a to initialize title and author, respectively. Which of the following code snippets correctly creates an object of the Book class with the title "The Catcher in the Rye" and author "J.D. Salinger"?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

. Consider a class Person with private instance variables name and age, and a parameterized constructor that takes two parameters n and a to initialize name and age, respectively. Which of the following code snippets correctly creates an array of three Person objects, with the names "Alice", "Bob", and "Charlie", and the ages 25, 30, and 35, respectively?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation