Я пытаюсь прочитать ввод пользователя в консоли и проверить, существует ли файл или папка без ввода полного пути? Это мой код:проверить ввод с консоли
import java.io.*;
import java.util.*;
public class FileManager {
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(System.in);
System.out.print("Enter file/folder: ");
String input = scan.nextLine();
File fileIn = new File(input);
while (!fileIn.exists()) {
System.out.print("File/folder does not exit! Enter another: ");
input = scan.nextLine();
fileIn = new File(input);
}
}
}
Итак, в чем ваш вопрос здесь? – rokonoid