What are the datatype generics for the Classes:
I get these warning messages regarding declaration:
private static IntervalXYDataset createReturnDataset(String title, ArrayList X, ArrayList Y)
Now I have tried to change this as follows
private static IntervalXYDataset createReturnDataset(String title, ArrayList<int> X, ArrayList<int> Y)
private static IntervalXYDataset createReturnDataset(String title, ArrayList<double> X, ArrayList<double> Y)
and neither work
Error Message:
ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized
line 484 Java Problem
DefaultIntervalXYDataset;
XYIntervalSeriesCollection.
HistogramDataset;
SimpleHistogramDataset;
TimePeriodValuesCollection;
TimeSeriesCollection;
Very basic question - What are the Generics for ....
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Re: Very basic question - What are the Generics for ....
Generic parameters allow compile-time type checking. Primitive types, such as int and double, are not valid generic parameter types. Instead, use the corresponding wrappers types, such as Integer or Double. For more flexibility, code to the interface type, e.g. List<Integer> or List<Double>.