try{
File f = new File("a.txt");
}catch(Exception e){
}catch(IOException io){
}
Is this code create new file name a.txt ?
try{
File f = new File("a.txt");
}catch(Exception e){
}catch(IOException io){
}
A. true
B. false
C. Compilation Error
D. None of these
Answer: Option C
Solution(By Examveda Team)
IOException is unreachable to compiler because all exception are going to catch up by Exception block.
Which class is used to read data from the keyboard in Java?
A. Scanner
B. FileReader
C. BufferedReader
D. InputStream
What is the purpose of the `System.out.println()` method in Java?
A. It performs mathematical operations
B. It writes data to a file
C. It reads data from the keyboard
D. It prints data to the standard output stream followed by a newline
How can you close a file after reading or writing in Java?
A. By using the `terminate()` method
B. By using the `close()` method of the file stream
C. By using the `readLine()` method
D. By using the `terminate()` method
Join The Discussion