Guest User

Untitled

a guest
Jun 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. ## INTERFACE
  2. public interface Cloneable<T> extends java.lang.Cloneable {
  3. public T clone();
  4. }
  5.  
  6. ## AUFRUF
  7. public void fill(T obj)
  8. {
  9. for(Coord c : this.range)
  10. {
  11. if(obj instanceof Cloneable<T>) // GEHT NICHT!
  12. {
  13. Cloneable<T> cloneable = (Cloneable<T>)obj;
  14. obj = (T)cloneable.clone();
  15. }
  16. this.put(c, obj);
  17. }
  18. }
Add Comment
Please, Sign In to add comment