InputStream クラスの 1 つのメソッドについて質問があります。
次のようなものがあります。
InputStream is;
byte[] b = new byte[64];
is.read(b);
// and now the byte array b contains data comming through InputStream???
.read()
メソッドの使用法が次のようになるかどうかはわかります。
b = is.read();
read メソッドはバイト配列を返すためです。
しかし、実際のメソッドはどのようにしてその引数に何かを書き込んで、それをそれ自体の外に見えるようにすることができるのでしょうか?
それは私がこれを持っているようなものです:
String myString = "myText";
public void myMethod(String s) {
s = "abc123";
}
myMethod(myString);
// and now is the content of myString equal to "abc123" instead of "myText" ???
// ANSWER: no!
返信ありがとうございます。