private TableColumn<?, ?> colname;
I want to know what is use of this in declaration of tablecolumn.
private TableColumn<?, ?> colname;
I want to know what is use of this in declaration of tablecolumn.
In Java, the ? type is simply a wildcard. It means any class. You can read more on this at http://docs.oracle.com/javase/tutorial/java/generics/wildcards.html
Probably, you got this TableColumn<?, ?>
wildcard based definition from skeleton code generated by JavaFX SceneBuilder. When SceneBuilder generates the code, it doesn't know the types to be applied to table columns, so it just generates wildcard types.
You should edit the the declaration to supply the appropriate types for your table column, for example TableColumn<Person,String>
, unless you really want to use wildcard types, which is unlikely for this case. In the sample I provided, Person
is the type of each row item in a table and String
is the type of a field of person to be represented in the table column (for example a firstName
).