6 years ago in Java Socket Programming

What is the output of this program?


import java.io.*;
class streams {
public static void main(String[] args) {
try {
FileOutputStream fos = new FileOutputStream("serial");
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeFloat(3.5);
oos.flush();
oos.close();
}
catch(Exception e) {
System.out.println("Serialization" + e);
System.exit(0);
}
try {
FileInputStream fis = new FileInputStream("serial");
ObjectInputStream ois = new ObjectInputStream(fis);
ois.close();
System.out.println(ois.available());
}
catch (Exception e) {
System.out.print("deserialization");
System.exit(0);
}
}
}

[A] 1
[B] 2
[C] 3
[D] 4
Loading...
Next Question

Create your Digital Resume For FREE on your name's sub domain "yourname.wcard.io". Register Here!


Overall Stats

Attempted 26
Correct 4
Incorrect 4
Viewed 18

Answers

Guest
Guest
Nazia Sayed
Nazia Sayed - 4 years ago

Nazia Sayed from Mumbai, India is saying 4 is correct answer

AJAY TIWARI
AJAY TIWARI - 4 years ago

AJAY TIWARI from Patna, India is saying 3 is correct answer

ashi yadav
ashi yadav - 4 years ago

ashi yadav from Auraiya, India is saying 4 is correct answer

Shaikh Anarul
Shaikh Anarul - 4 years ago

Shaikh Anarul from Singapore, Singapore is saying 3 is correct answer

Sayed badruzama
Sayed badruzama - 4 years ago

Sayed badruzama from Mumbai, India is saying 4 is correct answer

Related Questions

Which of these package contains classes and interfaces for networking?

  • [A] java.io
  • [B] java.util
  • [C] java.net
  • [D] java.network