"Non-static method" error

Asked

Viewed 39 times

-1

Below is my part of the code that is giving this problem: "Non-static method' write(byte[], int,int)' cannot be refenced from a Static context".

inserir a descrição da imagem aqui

I don’t understand this error message!

Could you help me with that?

What it really means and why is it appearing in this snippet of my code?

Thank you very much!

1 answer

1


You need to know what static members are to understand why this warning.

In this case, the method write() can only be called from an instance of the class ByteArrayOutputStream, i.e., you would need to create an object of the type ByteArrayOutputStream and hence call the method write().

Browser other questions tagged

You are not signed in. Login or sign up in order to post.