Question: I have written two programs WriteInts.java and ReadInts.java when I run ReadInts.java it outputs 16 five times. I need to know why it is not

I have written two programs WriteInts.java and ReadInts.java when I run ReadInts.java it outputs 16 five times.I have written two programs WriteInts.java and ReadInts.java when I run ReadInts.java

I need to know why it is not displaying the proper numbers. which are 16, 31, 90, 45, 89.

Here is the code for both classes.

import java.io.*;

class WriteInts{ WriteInts(String s, int b[]){ int i; try{ File f1 = new File(s); long size = f1.length(); if(size == 0){ FileOutputStream fout = new FileOutputStream(f1); DataOutputStream dout = new DataOutputStream(fout); for(i=0; i

import java.io.*;

class ReadInts{ public ReadInts(String fn){ int x; try{ File f1 = new File(fn); long size = f1.length(); if(size != 0){ int i; for(i=0; i

E Command Prompt Re:C:\Users\courteorive Desktop java la 5ev RedIn Valton Congle Chme CAU.wapwa label. Nuspade File Edit Serch Wir freeding Language Setting Too: WD Bum Plugins Vinden? QDBROODC59E1FOOD wa mjas Raditz 3 9. I have noc vive a code to my studie LE LE LO TE . FIDE for le OrfiInhu.. C:\Users\court oreOrive Desktopnjeva lab > 13 14 class Readin public EcoInte(string in int) Test Court j Fit Home Share A 142yit PASAN D- LPCU Paste shortcut Fnbul Cp Pa 13 Cipboa Properties 7 Ne moldes N. N- Edi. History HS-le+ Sande met clection sal tryl Tile +1-D Tile(ta) long wi- (lung(): if(size 1- 0) int in for(i=0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!