J
Jowita
I was having problems with generic ArrayList, so I created a little
test.
Here it is:
import java.util.*;
public class test{
public void blah(){
ArrayList<String> arString = new ArrayList<String>();
String s1 = "testing";
arString.add(s1);
String s = arString.get(0);
}
}
I cannot compile the above, this is the method I get:
test.java:7: '(' or '[' expected
ArrayList<String> arString = new ArrayList<String>();
I installed the latest Java SE 6.
Can anyone point out what's worng with the code?
test.
Here it is:
import java.util.*;
public class test{
public void blah(){
ArrayList<String> arString = new ArrayList<String>();
String s1 = "testing";
arString.add(s1);
String s = arString.get(0);
}
}
I cannot compile the above, this is the method I get:
test.java:7: '(' or '[' expected
ArrayList<String> arString = new ArrayList<String>();
I installed the latest Java SE 6.
Can anyone point out what's worng with the code?