Java Programming Fundamentals
Casual Mode - Take your time!
1 / 13
Correct
0
Incorrect
0
Score
0%
Multiple Choice
- Assume that in the current directory test.txt file is already exist. What will happen when you execute the following code? import java.io.*; class Test { public static void main(String args[]) { try { File file = new File("test.txt"); file.createNewFile(); } catch (IOException ex) { ex.printStackTrace(); } } }
- text.txt will be created and overwrite the old file
- file will not be created
- exception will be thrown
- none of the above