Question: Write a Java program to Create an array of objects of the Person class, of size 4. Create three objects of the Person class, with
Write a Java program to Create an array of objects of the Person class, of size 4.
Create three objects of the Person class, with values, and assign the objects to the array.
Loop through the array and print the name, job, and email of all person.
Q-3) Write a java program by using the following information.
Create a Class name for the class Year
Declare the attributes as Months, Weeks, Days with the suitable data types.
Create an empty constructor for the class Year.
Create an accessor method getDays( ) and return the numbers of Days.
Create a mutator method as setMonths( ) with the parameter list of months_name.
Q-4)
a) Draw a class diagram by a box with the name of the following class, list of attributes, and list of methods.
Class name : Book
Attributes names : title, authors
Methods : getTitle() : String
getAuthors() : String
addAuthors() : name
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
