I have program that gets file java program < file.txt
and i want to make exception for case when user dont give an file input just: java program
but I couldnt find any exception for that and when I am trying to check it with
Scanner input = new Scanner(System.in);
String tmp;
try {
tmp = input.nextLine();
}
catch(Exception e){
return 0;
}
nothing happens.