PRO192_-_C2_-_RE_-_SU_2023_558.webp
N

PRO192_-_C2_-_RE_-_SU_2023_558.webp

(Choose 1 answer)

Suppose the current directory does not contain a sub-directory named "dir"What happens when you try to compile and run the following application?
10. import java.io.*;11. public class Main {
12. public static void main(String argv[]) {
13.try {
14.File d = new File("dir");
15.File f = new File(d,"fi.txt");
16.if(!f.exists()) {
17.f.createNewFile();
18.}
19.}catch (IOException e) {
20.e.printStackTrace ();
21.}
22. }
23.}
A. Line 17 is never executed.
B. Line 17 throws an exception at runtime.
C. Line 15 throws an exception at runtime.
D. Line 17 creates a directory named "dir" and a file "fi.txt" within it.
E. Line 15 creates a directory named "dir" and a file "fi.txt" within it.
E26

Thông tin

Category
PRO192
Thêm bởi
Naobito2000
Ngày thêm
Lượt xem
2,042
Lượt bình luận
23
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_C2_-_RE_-_SU_2023_558.webp
File size
64.4 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom