permaculture playing cards*
The moose likes Beginning Java and the fly likes ArrayList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "ArrayList" Watch "ArrayList" New topic
Author

ArrayList

abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635



Initial size of al: 0
size of al after additions 7
contents of al: [C, A2, A, E, B, D, F]
size of after deletions : 5
contents of al:[C, A2, E, B, D] [1, 2, 3, 4]

May you explain about this output:
[1, 2, 3, 4]
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

abalfazl hossein wrote:...
May you explain about this output:
[1, 2, 3, 4]

I have no idea. That does not appear when I run your code.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Anupam Jain
Ranch Hand

Joined: Mar 16, 2010
Posts: 61

marc weber wrote:
abalfazl hossein wrote:...
May you explain about this output:
[1, 2, 3, 4]

I have no idea. That does not appear when I run your code.


Yup, It doesn't appear to me either...


SCJP-6.0 OCPJWCD-5.0
prem pillai
Ranch Hand

Joined: Nov 02, 2007
Posts: 87

abalfazl , have you posted the same code which you are running?
Looks like there was a System.out.print statement after line 33 which prints another list.
You might have removed that statement and then directly ran it (but forgot to compile the modified code before running it).

Also,


You can use a single statement instead of the above two statements.

println() adds a line separator et the end of the output automatically.
 
jQuery in Action, 2nd edition
 
subject: ArrayList
 
Similar Threads
Help me solve a puzzle on datastructures
List and Autoboxing
unsafe operation??
Doubts regarding ArrayLists
Generics question List with super