Consider the following:
public class Capture extends Thread {
private byte[] data;
public Capture(byte[] data) {
this.data = data;
}
@Override
public void run() {
// do something with the data byte array
}
}
Would the data
argument in the constructor be passed as reference to the new Java thread or would the object be re-instantiated, thus duplicating the memory?