Comment on Tutorial - How to use ArrayList in Java By Hong



Comment Added by : Venus

Comment Added at : 2011-02-11 09:09:55

Comment on Tutorial : How to use ArrayList in Java By Hong
Thanks, I understand the add function better now (found out it will expand the size as it needs).

However, I noticed that you didn't set the capacity of ArrayList al during the initiation. According to the API, the default size of an ArrayList is 10. But on your output, it says 0, are you sure nothing is missing on the code?

Thanks again


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Hi,
this is excellent stuff and I highly ap

View Tutorial          By: Nanda at 2007-11-02 04:58:30

2. I have mobile connecting to pc 3 options come com
View Tutorial          By: Sumit Sharma at 2012-04-13 16:32:15

3. Basic Example to undestand java literal persons
View Tutorial          By: Sajid mestri (maha,sangli) at 2010-10-30 00:44:44

4. Good one.. great for beginners..
View Tutorial          By: varun at 2009-09-29 14:18:04

5. Great!!!!!!!!!!!!!!!!!!!!
View Tutorial          By: Raghbendra Nayak at 2012-03-28 12:54:35

6. it is a good example thanks
View Tutorial          By: tadeleh at 2012-11-13 12:46:08

7. how to append more items in multiple choice group
View Tutorial          By: GIRIDHARAN at 2013-03-25 19:05:09

8. Nice example. I think this is more idiomatic tho'.
View Tutorial          By: John Morrison at 2010-03-28 14:55:07

9. Dear All, I am getting the following exception for
View Tutorial          By: Protik Basu at 2008-10-31 05:30:36

10. The above codes is working for me~
yeah, wh

View Tutorial          By: rejectee at 2009-10-23 22:14:25