Question: Define and develop IWQ Java classes: Star and Galaxy 1. The class Star should contain several basic features of a star (such as its name

 Define and develop IWQ Java classes: Star and Galaxy 1. The

Define and develop IWQ Java classes: Star and Galaxy 1. The class Star should contain several basic features of a star (such as its name (String), diameter (double), age (int), surface temperature (double), etc) 2. The class Galaxy should re-use the class Star by COMPOSITION (i.e., you should make an array of Star objects as an instance variable in the Galaxy class), and define some additional features such as the name of the galaxy (String), number of stars (int), the diameter of the galaxy (double), etc. 3. BOTH CLASSES should contain more than one constructors (including the copy constructor for Star class) and a pair of set/get methods (accessor and mutator methods) for each data field, and the toString method for both of them 4. Also include a main method to build up ONE galaxy with at least three stars. You should also be able to print out all the info either to the console or using the pop-up window. 5. Please make sure that your Java classes are properly indented and also include comments as necessary to clearly indicate the different functional blocks as well as the usage of methods

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!