Let's say I'm creating a jar file and have an icon in an asset folder to be included in the jar.
So before using, stage.getIcons().add(icon);
in my code is there any particular advantage or disadvantage to having the icon as
Image icon = new Image("Assets/Icon.png");
Vs.
Image icon = new Image(getClass().getResourceAsStream("Assets/Icon.png"));
Both seem to work fine, so I'm looking to pinpoint which I should generally gravitate towards and why.
There's a related topic here but it compares loading styles mostly with web applications.