Java getResource, to URI method

Asked 2 years ago, Updated 2 years ago, 22 views

java

2022-09-22 10:57

3 Answers

I can't tell you exactly because I haven't used the method myself, but I can infer it as a method to import resources according to the URL ../music/ is a URL creation method using a relative path. Two periods represent the parent folder at the current location.

I don't understand question number three.


2022-09-22 10:57

Reverse slash or backslash \ is a special character that separates paths in the Windows file system. In Java, reverse slash is a special character that starts an escape character (a character that performs a special function), so you use it twice in a row to mean reverse slash itself.

Slash / is a special character that distinguishes paths in Unix-like file systems. Unlike the reverse slash, it is not an escape character, so you can use only one.

Most methods that deal with files or paths are written to replace themselves inside where the reverse slash is coming from. So you can use slashes or reverse slashes (in this case, twice in a row).


2022-09-22 10:57

Thank you both so much!


2022-09-22 10:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.