class Cell A value; Cell(A v){ value = v; } A get(){ return v; } void set(A v){ value = v; } } Cell x = new Cell("abc"); x.value; // ok, hat Typ Object x.get(); // ok, hat Typ Object x.set("def"); // warnung: unchecked call