Question: In Java please I have a parent class Vehicle, a Child class Car, a node class and a GDLL class to add, delete and print

  • In Java please

I have a parent class “Vehicle”, a Child class “Car”, a node class and a GDLL class to add, delete and print lists.

My “Vehicle” class has a “equals” method and my “Car” class has a compare to method for my GDLL class

public boolean equals (Object obj) { if (this == obj) return true;if (obj == null || getClass() != obj.getClass()) return false; Vehicle modelOfVehicle

My GDLL class deletes nodes if 2 elements have the same model.

Everthing seems to work. I just need an Insertion sort method to sort the nodes by “model” first level and “release date” second level based on my “Car” compareTo method.

Thank you for your help!!
 

public boolean equals (Object obj) { if (this == obj) return true; if (obj == null || getClass() != obj.getClass()) return false; Vehicle modelOfVehicle = (Vehicle) obj; return Objects.equals(model, modelofVehicle.model);

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 Programming Questions!