Hi all,
I have the following code.
import java.util.*;
import java.io.*;
import java.util.*;
import java.io.*;
public class ShufflingListAndArray
{
public static void main(String[] args) throws IOException
{
List <String> services = new ArrayList<String> (
Arrays.asList("COMPUTER", "DATA", "PRINTER"));//here I have used List <String> services=new ArrayList<String>( Arrays.asList("COMPUTER", "DATA", "PRINTER"));// followed by next statement Satring s=Services.get(rnd.nextInt(Services.size()));
String s = services.get(rnd.nextInt(services.size()));
Collections.shuffle(list);
//Collections.sort(list);
System.out.println("List sorting :"+ list);
}
}
When I compile this program I get the following error.
C:\>javac ShufflingListAndArray.java
ShufflingListAndArray.java:6: '(' or '[' expected
List<String> services = new ArrayList<String>(
^
1 error
Please help me to resolve this error.Thanks a lot.