summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Immutable.java
blob: a6c0f3edc3b843498e65ef327f98e1311a355d3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class Immutable
{
  private int      value1;
  private String[] value2;

  public Immutable(int value1, String[] value2)
  {
    this.value1 = value1;
    this.value2 = (String[])value2.clone();
  }

  public int getValue1()
  {
    return value1;
  }

  public String getValue2(int index)
  {
    return value2[index];
  }
}