PRO192_-_C2_-_RE_-_SU_2023_558.webp
N

PRO192_-_C2_-_RE_-_SU_2023_558.webp

Answer (Choose 1 answer)
}

What happens when you try to compile and run the following application?
import java.io.*;
class A {
String name; int age;
A(String na, int ag) {name=na;age=ag;}
} public class Main{
public static void main(String argv[]){
try {
File f = new File("xxx.ser");
FileOutputStream fos = new FileOutputStream(f);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(new A("HOA", 22)); //(1)
oos.close(); //(2)
fos.close();
}
catch (Exception x) {}
A. Compiler error at line (1).
B. An exception is thrown at line (1).
C. An exception is thrown at line (2).
D. No compiler error and no exception.
El 19

Thông tin

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

Image metadata

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

Share this media

Back
Bên trên Bottom