+ 1
How To scan input as a path in string var in java?
String str = scanner.XXXX(); //What is XXXX for take input as Path. //IF any other way tell me please...
2 ответов
+ 3
if input is keyboard or text file
get string by .nextLine() and
convert it to correct path
+ 1
If you mean a directory, it is used for other methods (eg. JFileChooser) in a form of String. So you use standard next or nextline methods just as you would normally for getting a String from the Scanner