I need a small Container-Class for storing some Strings which should be immutable. As String itself is an immutable type, I thought of something like that:
interface Immu { String getA() ; String getB ( ) }
Immu immu ( final String a , final String b )
{
/* validation of a and b */
return new Immu ( )
{
public String getA ( ) { return a ; }
public String getB ( ) { return b ; }
}
}