[Solved] List table=null; in java


This code declares a variable tables of type List<Data>, and initialize it to null. (I change your data to Data to match the java convention)

I think you’re in trouble with the <Data> part.

So let me say:
List is a generic class, which can be parametrized with another type. You can write List<String> or List<Number> for example, and List::get(int index) returns an object of the parametrized type.

More information in the Oracle’s tutorial about generic types.

solved List table=null; in java