0

What is the error? See the code in description

import java.io.*; public class Program { public static void main(String[] args) throws IOEception { DataOutputStream c=new DataOutputStream("csd"); c.writeUTF("dyeyh") ; c.writeDouble(63) ; DataInputStream b=new DataInputStream("csd"); System.out.println(b.readUTF()); System.out.println(b.readDouble()) ; } }

25th Jan 2017, 5:14 PM
sis
sis - avatar
1 Answer
0
I may be wrong, but you are using a "DataOutputStream" to input data, and a "DataInputStream" to output the data. Try switching those.
25th Jan 2017, 5:18 PM
NickB
NickB - avatar