Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
The community reviewed whether to reopen this question 2 years ago and left it closed:
Original close reason(s) were not resolved
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
您可以调用类
arrayList
,但这是一个非常糟糕的主意。最好重命名。其次,您有两个具有相同名称的变量,这是禁止的。正确的代码看起来像:You can call your class
ArrayList
but it is a very bad idea. Better to rename it. Second, you have two variables with the same name, which is forbidden. A correct code looks like:将课堂名称重命名为其他。
arrayList
是带有java.util
软件包的类由于您导入了
java.util。*
,因此程序无法从util
软件包中选择此类或类。Rename class name to something else.
ArrayList
is a class that came withjava.util
packageSince you imported
java.util.*
, the program can't select this class or the class fromutil
package.您使用的是相同的名称,因此在计算机存储中,如果编译器不干预,它们将相互覆盖(理论上)。只需在您的两个变量中添加一个指示器,例如“ 1”和“ 2”!
You are using the same name, so in the computers storage they would overwrite each other (in theory), if the compiler wouldn't intervene. Just add an indicator to your two variables, like '1' and '2'!