What datatype supports this kind of operation?
<p>I am currently writing a machine simulator, and this machine has 256 registers, each have their unique name, index and data. What kind of datatype would support this operation?</p>

<p>Below are some example operations:</p>

<pre><code>String output = Registers.RegA.data.toString(); //Returns the value of RegA
System.out.println(output);

Registers A = Registers.RegA; //points A to RegA
Registers AA = Registers.at(0) //Index access Registers, which returns RegA in this case.

A.data = new DataObj("I am a pie");
output = AA.data.toString(); //A and AA both point to RegA, therefore they share the same data
System.out.println(output);
//Expected output: "I am a pie"

output = Registers.RegA.data.toString(); //RegA data is shared across the system
System.out.println(output);
//Expected output: "I am a pie"
</code></pre>

<p>What kind data type would support above operations?</p>
