-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
  • 85,076
  • 16
  • 154
  • 332
Kris Martele
  • 29
  • 1
  • 7

1 Answers1

2

If you need an ArrayList

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

LinkedList

List<TreeItem> list = new LinkedList<TreeItem>();
underdog
  • 4,447
  • 9
  • 44
  • 89