-2

I need to make array or list of a class.

My class

public class TreeItem {
 private int key;//tankstation Id
 private String regio;
 private String gemeente;//tankstation naam
 private String brandstof;
 private String tankInhoud;
 private String maxTankInhoud;
 private String minWaarde;
 private String drempelWaarde;
 ....
 }

In C# you could make a list just by

List<TreeItem> list = new List<TreeItem>();

How do you do this in Java?

Luiggi Mendoza
  • 83,472
  • 15
  • 149
  • 315

1 Answers1

2

If you need an ArrayList

List<TreeItem> list = new ArrayList<TreeItem>();

LinkedList

List<TreeItem> list = new LinkedList<TreeItem>();
underdog
  • 4,368
  • 8
  • 40
  • 85