I am trying to create a method that should dynamically accept the string values and store it in an array list.Am trying to achieve method overloading here. Please see the below example and help me resolve in this:
public static void main(String[] args){
verifyFilesInFolder("folder1", "file1", "file2", "file3");
verifyFilesInFolder("folder2", "file1", "file2");
}
verifyFilesInFolder(String folder, ArrayList ???)
{
List<String> list = new ArrayList<String>();
int size=list.size();
for(int i=0; i<size;i++){
list.add(i); // is this correct??
}
}
After storing it in the array list, i want to compare this expected list with Actual list captured from the application by sorting.
Hope you got the point am looking for. If not ArrayList, please suggest me a way to achieve this by having only one method but the number of files may change while calling that method.