PRO192_-_SP_2024_-_RE_1741.webp
Izumi991

PRO192_-_SP_2024_-_RE_1741.webp

  • Media owner Izumi991
  • Ngày thêm
(Choose 1 answer)
import java.io.*;
What happens when you try to compile and run the following application?
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.


Q: 26

Thông tin

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

Image metadata

Filename
PRO192_-_SP_2024_-_RE_1741.webp
File size
238.8 KB
Dimensions
1920px x 892px

Share this media

Back
Bên trên Bottom