Question: pls use java as easy as possible, since I am a first-year colleger P1: LandTract class. Make a LandTract class that has two fields: one

pls use java as easy as possible, since I am a first-year colleger

P1: LandTract class. Make a LandTract class that has two fields: one for the tracts length and one for the width. The class should have

a constructor with two parameters,

a copy constructor performing a deep copy

an equals method (comparing the area),

a compareTo method

and a toString method.

Demonstrate the class in a program (i.e. a demo class with a main method) that asks the user to enter the dimensions for two tracts of land and creates the land tract objects.

The program should also create two cloned land tract objects from these origianals using the copy constructor. It should display each tract of land (using the toString method). It should compare two land tracts (using the compareTo method) and print out which one is bigger, and indicate whether one of the cloned tracts is equal (using the equals method) to its original.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!