Adhouma / Sets-challenge

Java Sets challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sets-challenge

/**
 * Create a HeavenlyBody class that demonstrate planets on the solar system
 * The HeavenlyBody fields are: 
 * - name (String)
 * - orbitalPeriod (double)
 * - satellites (Set)
 * 
 * Create a addMoon method that allows you to add a moon of the type HeavenlyBody to the satellites
 * 
 * In the Main class:
 * Create a Map called solarSystem <String, HeavenlyBody> as the key is the planet name
 * Create Set called planets contains the planets
 * 
 * Try to add as many as you want planets to the solarSystem and to the planets Set
 * Try adding duplicate planets
 * PS: Duplicate planets are ignored in Set 
 * 
 * Find a solution to ignore duplicate planets
 */

About

Java Sets challenge


Languages

Language:Java 100.0%