diff --git a/5-arrays-arraylists/Playlist.java b/5-arrays-arraylists/Playlist.java index d698086..fc17e85 100644 --- a/5-arrays-arraylists/Playlist.java +++ b/5-arrays-arraylists/Playlist.java @@ -31,19 +31,18 @@ public static void main(String[] args) { desertIslandPlaylist.remove("MF DOOM - Guinnesses"); desertIslandPlaylist.remove("Jean Grae - Threats"); - // System.out.println(desertIslandPlaylist); + System.out.println(desertIslandPlaylist); // swapping songs - int indexA = desertIslandPlaylist.indexOf("Buena Vista Social Club - Murmullo"); - int indexB = desertIslandPlaylist.indexOf("A Tribe Called Quest - Electric Relaxation"); - - String tempA = "Buena Vista Social Club - Murmullo"; + int indexA = desertIslandPlaylist.indexOf("A Tribe Called Quest - Electric Relaxation"); + int indexB = desertIslandPlaylist.indexOf("Buena Vista Social Club - Murmullo"); + String tempA = desertIslandPlaylist.get(indexA); - desertIslandPlaylist.set(indexA, "A Tribe Called Quest - Electric Relaxation"); + desertIslandPlaylist.set(indexA, desertIslandPlaylist.get(indexB)); // System.out.println(desertIslandPlaylist); desertIslandPlaylist.set(indexB, tempA); System.out.println(desertIslandPlaylist); } -} \ No newline at end of file +}