Which of the below ways of adding to a HashMap is more efficient (considering both time and space efficiency)?
Way 1:
Music foo = new Music(Files.getMusic("bar/bold.mp3"));
HashMap.put("rock", foo);
Way 2:
HashMap.put("rock", new Music(Files.getMusic("bar/bold.mp3")));