package com.tutego.insel.generics;

import java.awt.Point;

public class GenericBoxExample2
{
  @SuppressWarnings( {"unused", "unchecked"} )
  public static void main( String[] args )
  {
//    Box<String>  stringBox = new Box<String>();
//    Box<Integer> intBox    = new Box<Integer>();
//    Box<Point>   pointBox  = new Box<Point>();
    
    
    Box<String> stringBox = new Box<String>();
    Box pointBox  = new Box<Point>();
    Box objectBox = stringBox;

//    objectBox.setValue( new java.util.Date() ); // Warnung vor der „Unsafe type operation“
    System.out.println( pointBox.getValue() );
//    String s = stringBox.getValue();
//    System.out.println( stringBox.getValue() ); // führt zu einer ClassCastException

  }
}
