About Question enthuware.ocpjp.v8.2.1405 :
Posted: Fri Nov 04, 2016 7:28 am
Hej,
Question 49, Test 2, a) option said
File f = new File("x"); //1 will throw an exception at runtime if a file named "x" does not exist.
answer is:
You can always create a File object whether or not an actual file or directory by that name exists.
I have just create:
File f = new File("C:\\example.txt"); I do not have this on my disc and I receive exception.
Do you agree with me that it is mistake in this test?
The next option in test is also good but If I have to choose one I choose this.
Please help me.
Question 49, Test 2, a) option said
File f = new File("x"); //1 will throw an exception at runtime if a file named "x" does not exist.
answer is:
You can always create a File object whether or not an actual file or directory by that name exists.
I have just create:
File f = new File("C:\\example.txt"); I do not have this on my disc and I receive exception.
Do you agree with me that it is mistake in this test?
The next option in test is also good but If I have to choose one I choose this.
Please help me.