What is the difference between File.separator and File.pathSeparator?

Asked 2 years ago, Updated 2 years ago, 63 views

File class has two strings, separator and path-separator. What's the difference between the two?

file java path-separator

2022-09-21 16:11

1 Answers

The File.pathSeparator separates each file from its path. For example, when setting the path for a window environment variable, Separate multiple file paths with ;. File.pathSeparator separates files with ;

File.separator is a method that separates the path of a file, such as \, /. In Windows, C:\Documents\Test serves to separate these paths.


2022-09-21 16:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.