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. vry nice example....thanx..
View Tutorial          By: rekha at 2010-09-14 11:55:38

2. ""this"" is a implicit keyword
View Tutorial          By: Gangireddy at 2012-02-15 08:35:18

3. its a nice site bcoz it gives a bright IDEA about
View Tutorial          By: surya santhan at 2012-07-11 16:28:06

4. Hi Ashish, You just have to create an object of SM
View Tutorial          By: Ramlak at 2007-03-13 09:22:51

5. Thanks.I was searching the internet for a lot of t
View Tutorial          By: Habi at 2011-12-22 07:43:51

6. Can anybody tell.... what if condition is doing in
View Tutorial          By: Randhir Sambyal at 2013-08-26 06:37:25

7. java.lang.NoSuchMethodError: main

<

View Tutorial          By: mark at 2010-09-27 03:46:48

8. This will give the output check it out


View Tutorial          By: shruthi at 2013-01-18 06:00:08

9. very simple example.....................
View Tutorial          By: kajal at 2015-08-22 09:28:16

10. it is good site , and i have cleared my doubts
View Tutorial          By: imtiaz at 2009-10-15 23:43:50