Q:

Constructing a string from getResource("...") gives an output starts with "file:/"?

Lets consider image.png stored inside one of the project's package named icons, I usually get the icons via getResource() method :
String imgPath = getClass().getResource("/icons/image.png").toString();
//no problem with creating an ImageIcon with this path
Image img = new ImageIcon(imgPath).getImage();
//but the problem occures when trying to open this image through Desktop
//try-catch
Desktop.getDesktop().open(imagePath);
//or
File imgFile = new File(imgPath);
//error, this file does not exist!

I noticed that constructing a string from the URL gives the output that starts with file:/...., it makes no problem with loading the image, but opening the file not possible until removing file:/.
What's the benifit of file:/ that added to the string?

I thought that maybe the path is to a file, but I was wrong, even targeting to the folders gives this output.

A:

Its a URL path specific to files. 
Kinda how like web URLs have http://, https:// or ftp:// URL for file keeps that syntax thus file:/ was born .
For example copy an image like test.jpg to your C drive.
Than open your browser and type: 
file:/c:/test.jpg 
hit ENTERand the image should be loaded.

What's the benefit of file:/ that added to the string?

No real benefits, besides the fact it becomes a valid URL, it can only be used as a URL and not as a valid path to a file, for that you would omit file:/ as you have seen
See file URI scheme for more

