array required, but ArrayList found

后端 未结 7 1561
执念已碎
执念已碎 2021-02-06 07:47

I have a ruby backround and im new to java i wrote a basic programm but somehow i get a error i cant fix! My code:

import java.util.ArrayList;

public class Musi         


        
7条回答
  •  被撕碎了的回忆
    2021-02-06 08:25

    You have to use files.get(i) as your are using ArrayList and not Array. When you are using array at that time you will require its index location to fetch values from it.ArrayList provides get(i) method to fetch values from init.

提交回复
热议问题