I'm a second year student, just starting to pick up Java. I have this bit of code and it keeps throwing an exception:
try
{
masterFish = ImageIO.read(getClass().getResource("fish1.gif"));
}
catch (IOException iOException)
{
iOException.printStackTrace();
}
Can someone explain the part fish1.gif
? Should I have an image called fish1.gif
uploaded somewhere?
source
share