What Will Be The Output Of The Following Java Codep Pre #615

What will be the output of the following Java code?</p> <pre><code class="language-java" line="1"> import java.io.*; class streams { public static void main(String[] args) { try { FileOutputStream fos = new FileOutputStream("serial"); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeInt(5); oos.flush(); oos.close(); } catch(Exception e) { System.out.println("Serialization" + e); System.exit(0); } try { int z; FileInputStream fis = new FileInputStream("serial"); ObjectInputStream ois = new ObjectInputStream(fis); z = ois.readInt(); ois.close(); System.out.println(x); } catch (Exception e) { System.out.print("deserialization"); System.exit(0); } } }</code></pre>

Online Quiz This multiple choice question (MCQ) is related to the book/course gs gs128 Java. It can also be found in gs gs128 Java Serialization Networking - Java Serialization & Deserialization - Quiz No.1.


Similar question(s) are as followings:



Online Quizzes of gs128 Java

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background