【问题标题】:Cannot get an Array of ArrayList of PVectors to work无法使 Pvector 的 ArrayList 数组工作
【发布时间】:2018-01-19 02:06:43
【问题描述】:

由于某种原因,处理编辑器给了我一个The class "Vectors" does not exist ...我错过了什么?

int num_gradations = 100;

ArrayList[] AllGradation = new ArrayList[num_gradations];
ArrayList<PVector> Vectors = new ArrayList<PVector>();

void setup() {
  size(700, 700, P2D);
  smooth(8);
  randomSeed(20);

  for (int l = 0; l>num_gradations; l++) {
    AllGradation[l] = new Vectors();
  }
}

【问题讨论】:

  • Vectors 是变量而不是类型
  • 呃。呃。谢谢你。回答我自己的问题...

标签: java arrays arraylist processing


【解决方案1】:

这是正确的方法:

int num_gradations = 100;

ArrayList[] AllGradation = new ArrayList[num_gradations];

void setup() {
  size(700, 700, P2D);
  smooth(8);
  randomSeed(20);

  for (int l = 0; l>num_gradations; l++) {
    AllGradation[l] = new ArrayList<PVector>();
  }
}

【讨论】:

    猜你喜欢
    • 2022-12-02
    • 2016-10-14
    • 1970-01-01
    • 1970-01-01
    • 2023-04-05
    • 2015-12-21
    • 1970-01-01
    • 1970-01-01
    • 2021-01-21
    相关资源
    最近更新 更多