Icon bug = new ImageIcon( getClass().getResource( "bug1.png" ) );
ImageIcon bug = new ImageIcon( getClass().getResource( "bug1.png" ) );
What's the difference between these two? My book always uses the way in the first line to declare an ImageIcon
but wouldn't it be better to declare it the second way because more specifically it is an ImageIcon
?