Java: initialization problem, cannot print "assigned" values from arrayList
- by HH
$ javac ArrayListTest.java
$ java ArrayListTest
$ cat ArrayListTest.java
import java.io.*;
import java.util.*;
public class ArrayListTest{
public static void main(String[] args) {
try {
String hello ="oeoaseu oeu hsoae sthoaust hoaeut hoasntu";
ArrayList<String> appendMe = null;
for(String s : hello.split(" "))
appendMe.add(s+" ");
for(String s : appendMe)
System.out.println(s);
//WHY DOES IT NOT PRINT?
}catch(Exception e){
}
}
}