Try compiling with the javac command so you can get error messages if you can't figure out how to use the IDE.
Type: Posts; User: Norm
Try compiling with the javac command so you can get error messages if you can't figure out how to use the IDE.
Then where is the ending ]
ArrayList<String> al = new ArrayList<String>();
al.add("SSS");
System.out.println(al); // [SSS]
sorry, I have no idea what you are talking about.
Why are you adding a null entry to the list of listeners?
It depends on what the code is supposed to be doing. If you need the contents in an array, that would be the method to use.
Where did the [ on the second line before the null come from?
What does the toArrar() method do?
If mycustomer is an arraylist, how do you want to get to its contents so you can display them?
You need to track the data from where it enters the program to where you are getting null values instead of the data.
Where does the "[null null" come from? With the leading [
Where does the null value come from? What variable is getting set to null? Where do you originally have the data? What is the path of the data from its source to where you want to get it for display...
Yes, Making the arraylists class members (and not shadowing them in methods) will allow all the methods in the class to access them to add and get data.
If you want different methods in the class to be able to get the data in the arraylist, you should define it at the class level and assign it a value.
You should NOT define a variable in a method...
One problem I see is that the myCustomer variable is defined and given a value inside of a method.
When the method exits, that variable and its values are gone.