public abstract class Parent { private String field1; privat…

public abstract class Parent { private String field1; private int field2; public Parent(String f1, int f2) { field1 = f1; field2 = f2; } public abstract void foo(); public String toString() { return String.format(“field1: %s, field2: %d”, field1, field2); }} Given the abstract class above, create a concrete subclass that only provides the minimum necessary implementation to satisfy the following requirements: The subclass should be named Child The subclass should have an additional private field of type double named field3 The subclass should include a single public 3-argument constructor that uses proper constructor chaining to initialize all three data fields The subclass should be able to print out the names and values of all three data fields, in any order. Extra or unnecessary code may result in a deduction of points. Think carefully about the minimum necessary implementation to meet these requirements. Method names do not have to reflect their behaviors. Make sure to select the ‘Preformatted’ style from the dropdown so your code is formatted clearly. DO NOT USE THE TAB KEY WHEN WRITING CODE AS YOU MAY ACCIDENTALLY SUBMIT YOUR EXAM. USE THE SPACE BAR INSTEAD.

Given the class below, correctly override Object’s equals me…

Given the class below, correctly override Object’s equals method in this class, ensuring that it compares the full state of the object (i.e. the values of all data fields).Include the method header, curly braces, and implementation in your response. public class Planet {    private byte numMoons;    private String name;    /* valid constructor */    /* YOUR equals METHOD HERE */} Make sure to select the ‘Preformatted’ style from the dropdown so your code is formatted clearly. DO NOT USE THE TAB KEY WHEN WRITING CODE AS YOU MAY ACCIDENTALLY SUBMIT YOUR EXAM. USE THE SPACE BAR INSTEAD.