I have a simple question: I am working on a JavaFX application and need a reference to a specific class. I looked my problem up on the Internet and found out that I had to use getResourceAsStream
instead of getResource
. I looked up both methods and only found one difference. The getResourceAsStream
returns an InputStream
and the getResource
returns an URL
. But what is the difference, why is the InputStream
working for me and the URL
not? I never really worked with Stream
, any explanations are greatly appreciated.
getResource(String name)
getResourceAsStream(String name)