1

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?

S-K'
  • 3,188
  • 8
  • 37
  • 50

0 Answers0