Rafael Valls
Rafael Valls

Reputation: 111

DataOutputStream cannot be instantiated

DataOutputStream salida;

salida  = new DataOutputStream(socket.getOutputStream());

Error:(35, 24) java: DataOutputStream is abstract; cannot be instantiated

Upvotes: 0

Views: 162

Answers (2)

Khalid Shah
Khalid Shah

Reputation: 3232

you are using some other library for DataOutputStream. use this

    java.io.DataOutputStream salida;
    salida  = new java.io.DataOutputStream(socket.getOutputStream());

Upvotes: 1

cosmin_popescu
cosmin_popescu

Reputation: 196

Try importing the package java.io.*. DataOutputStream is in that package.

Upvotes: 1

Related Questions