Weekend Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ac4s65

Given:javaimport java.

Given:

java

import java.io.*;

class A implements Serializable {

int number = 1;

}

class B implements Serializable {

int number = 2;

}

public class Test {

public static void main(String[] args) throws Exception {

File file = new File("o.ser");

A a = new A();

var oos = new ObjectOutputStream(new FileOutputStream(file));

oos.writeObject(a);

oos.close();

var ois = new ObjectInputStream(new FileInputStream(file));

B b = (B) ois.readObject();

ois.close();

System.out.println(b.number);

}

}

What is the given program's output?

A.

1

B.

2

C.

Compilation fails

D.

ClassCastException

E.

NotSerializableException

1z0-830 PDF/Engine
  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions
buy now 1z0-830 pdf
Get 65% Discount on All Products, Use Coupon: "ac4s65"