Having trouble importing java.util.Arrays

已回答

Hello, 

I am new to programming and learning from CodeAcademy. I wanted to learn how to program using IntelliJ at the same time to get used to how to program without CodeAcademy. My current problem is that I am learning about arrays and I am trying to import the array methods. On line 1 I have "import java.util.Arrays;" without the quotations. The problem that it is greyed out. I tried looking into ways to fix it but the only thing I could find is about using a version of IntelliJ Idea from 2015 but I currently have a version from 2022. 

1

IntelliJ IDEA marks the unused imports. Once you use classes or methods from the import in your code, it will automatically become used and the grey color will disappear:

2

I did not think of it that way. Thank you so much. 

0

请先登录再写评论。