processing - 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 ?
解决方案
尝试添加[]
到左侧的类型:
PrintWriter[] output = new PrintWriter[10];
简短说明:
您试图声明一个类型的变量PrintWriter
(不是数组),然后分配一个类型的值PrintWriter[]
(一个数组)。
推荐阅读
- sql - 如果行数 > X,则 SQL 返回值
- python - 使用 seaborn catplot 使用 python 可视化我的数据
- node.js - 尝试发帖时可能出现快递问题
- javascript - 为什么我的项目上的加载更多内容按钮不起作用?
- python - .txt 文件函数读/写位置
- php - 我如何获取最新的对象 laravel
- flutter - 没有带有名称的命名参数/没有为类定义方法/
- javascript - 将 Shopify/draggable 与 Alpine.js x-for 指令一起使用
- visual-studio - Visual Studio 新的 .NETCore(3.1 和 net5.0)项目在依赖项上显示黄色三角形,在清理和构建时失败,但没有显示错误
- java - “java.lang.StringIndexOutOfBoundsException”不允许我访问下一个用户输入