Explanatory Question
Example: IOException
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.
import java.io.FileReader; import java.io.IOException; public class CheckedExample { public static void main(String[] args) { try { FileReader file = new FileReader("non_existing_file.txt"); file.read(); file.close(); } catch (IOException e) { System.out.println("File not found or cannot be read!"); } } }
📘 Explanation:
The compiler forces you to handle IOException because the file may not exist or may not be readable.
First read the answer fully, then try to explain it in your own words. After that, open a few related questions and compare the concepts. This method helps you remember the topic for a longer time and improves exam preparation.