J
jski
public class Box<T>
{
private T t;
...
}
import java.util.List;
public class BoxMain
{
public static void main(String[] args)
{
Box<Float> box = new Box<Float>();
List<Box<Float>> boxes = new List<Box<Float>>(); <--- ERROR:
Cannot instantiate the type
List<Box<Float>>
box.add(new Float(3.14156));
boxes.add(box);
}
}
The ERROR above results in Eclipse. Why? ---jski
{
private T t;
...
}
import java.util.List;
public class BoxMain
{
public static void main(String[] args)
{
Box<Float> box = new Box<Float>();
List<Box<Float>> boxes = new List<Box<Float>>(); <--- ERROR:
Cannot instantiate the type
List<Box<Float>>
box.add(new Float(3.14156));
boxes.add(box);
}
}
The ERROR above results in Eclipse. Why? ---jski