Because you call a method that declares that it throws a FileNotFoundException, and you don't catch the exception, nor do you declare that the enclosing method throws it. This is not allowed in Java. All checked exceptions must either be caught, or declared in the throws
clause of the method:
static String getString() throws FileNotFoundException {
If you can handle the exception and do something meaningful that makes you program continue to work as expected, then catch the exception. If you can't handle it in this method, then let the caller of your method handle it for you, and let it propagate by declaring it in the throws clause.