@ viggom555:
Here is an example command line:
1) Create the file "ATest.java" (EXAMPLE: notepad ATest.java):
import java.util.*; public class ATest { public static void main (String[] args) { ArrayList<String> test = new ArrayList<String>(); System.out.println ("My array has " + test.size() + " items"); test.add ("abc"); System.out.println ("My array has " + test.size() + " items"); } }
2) Compile (EXAMPLE: "javac -Xlint: unchecked ATest.java", you do not need "XLint" in this example, I will just show you where it will go if you want):
C:\temp>javac -Xlint:unchecked ATest.java
3) Run the test program:
C:\temp>java ATest My array has 0 items My array has 1 items
I hope this helps .. PSM
source share