PRO192_-_SU_2023_-_Block_5_-_FE_735.webp
successful_man

PRO192_-_SU_2023_-_Block_5_-_FE_735.webp

39
Answer (Choose 1 answer)
A. Line 17 throws an exception at runtime.
B. Line 17 is never executed.
C. Line 17 creates a directory named "dir" and a file "fi.txt" within it.
D. Line 15 creates a directory named "dir" and a file "fi.txt" within it.
E. Line 15 throws an exception at runtime.

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.}

Thông tin

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

Image metadata

Filename
PRO192_-_SU_2023_-_Block_5_-_FE_735.webp
File size
59.8 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom