diff options
| author | pants <niklasjo2004@gmail.com> | 2026-09-21 14:16:22 -0700 |
|---|---|---|
| committer | pants <niklasjo2004@gmail.com> | 2026-09-21 14:16:22 -0700 |
| commit | 4a0d047e83141d3ebe48a2bf4ea58e1192a01333 (patch) | |
| tree | 7125d1be1df434ca98a1d08fb4a30ebd28730d19 /Review.java | |
Diffstat (limited to 'Review.java')
| -rw-r--r-- | Review.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Review.java b/Review.java new file mode 100644 index 0000000..cd449b4 --- /dev/null +++ b/Review.java @@ -0,0 +1,42 @@ +import java.util.*; + +public class Review { + // Create a Map of students in section to their favorite word/movie/song/etc + // Then, edit and print out the Map + + public static void main(String[] args) { + // Create the Map (do you want it to do ordered?) + Map<String, String> favorites = new TreeMap<>(); + // Add key/value pairs to the Map + favorites.put("me", "キュ毛付きさぼたじ"); + favorites.put("nik", "warp star"); + favorites.put("andy", "none"); + System.out.println(favorites); + // Delete one of the entries from the Map + favorites.remove("andy"); + // Override one of the values + favorites.put("boner", "balls"); + // Loop over the Map and print out all the values seperated by a comma and space + // Before printing - hypothesize what the output will look like! + for (String key : favorites.keySet()) { + System.out.print(favorites.get(key) + ", "); + } + + System.out.println(); + + Set<Integer> intset = new HashSet<>(); + + for (int i = 0; i < 10; i++) { + intset.add(i); + } + + System.out.println(intset); + + Stack<Integer> s = new Stack<>(); + System.out.println(s.isEmpty()); + + MusicPlaylist p1 = new MusicPlaylist(); + p1.addSong("ohyeahyeah"); + p1.playSong(); + } +} |
