• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

ArrayList  RSS feed

 
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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]
 
Sheriff
Posts: 11343
Java Mac Safari
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 61
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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...
 
Ranch Hand
Posts: 87
Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Can't .... do .... plaid .... So I did this tiny ad instead:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!