Create a class named Person that holds the following fields: two String objects for the person’s first and last name and a LocalDate object for the person’s birthdate. Create a class named Couple that contains two Person objects. Create a class named Wedding for a wedding planner that includes the date of the wedding, the names of the Couple being married, and a String for the location. Provide constructors for each class that accept parameters for each field, and provide get methods for each field. Then write a program that creates two Wedding objects and in turn passes each to a method that displays all the details. Save the files as Person.java, Couple.java, Wedding.java, and TestWedding.java.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Create a class named Person that holds the following fields: two String objects
for the person’s first and last name and a LocalDate object for the person’s
birthdate. Create a class named Couple that contains two Person objects. Create a
class named Wedding for a wedding planner that includes the date of the wedding,
the names of the Couple being married, and a String for the location. Provide
constructors for each class that accept parameters for each field, and provide get
methods for each field. Then write a program that creates two Wedding objects
and in turn passes each to a method that displays all the details. Save the files as
Person.java, Couple.java, Wedding.java, and TestWedding.java.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 1 images