首页 > 解决方案 > Creating an array of "PrintWriter" in processing?

问题描述

I want to create an array of the element "PrintWriter" (s) type but it tells me there is an error ! i'm new to java i don't understand why ? i think the way to declare an array is : type variable name[] = new type[size] this is the code:

PrintWriter output = new PrintWriter[10];

can some one help ?

标签: processing

解决方案


尝试添加[]到左侧的类型:

PrintWriter[] output = new PrintWriter[10];

简短说明:

您试图声明一个类型的变量PrintWriter(不是数组),然后分配一个类型的值PrintWriter[](一个数组)。


推荐阅读