The Planet class describes planets in general.
Every Planet has:
As well as these attributes, a Planet also has appropriate accessor/mutator methods and a toString() method which returns the values stored in a Planet object as a String.
Start a new project in your IDE and design the full Planet class.
Test it by constructing an instance of a Planet in another project and call the toString() method, displaying the returned value.
Pluta IS-A Planet.
However, unlike many other Planets, it is in the Kuiper Belt.
Design the full Pluta class, making sure an additional property indicating that it is in the Kuiper Belt is included.
Also, find a way of making sure that when we call the Pluto class's toString() method, that this information is displayed, along with its name, age etc.
When the Pluto class's getName method is called, it displays the name of the Planet along with the message (Dwarf Planet)
Override the Planet class's getName() method by creating a getName method in the Pluto class.
This method returns a String with the name of the Pluto instance followed by the text (Dwarf planet)
How can we update the Pluto class's toString() method to ensure that the information (Dwarf Planet) is included?
behavioursyntax method inherit instantiate constructor prototype attributeconcurrency