This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes regrading ArrayList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "regrading ArrayList" Watch "regrading ArrayList" New topic

regrading ArrayList

Prahlad Joshi
Ranch Hand

Joined: Apr 21, 2007
Posts: 44
* To change this template, choose Tools | Templates
* and open the template in the editor.

package newpackage;

* @author Administrator
import java.util.ArrayList;
public class Exp {
static ArrayList<String> asd=new ArrayList<String>(10);;
public static void main(String args[])



o/p is 0 not 10.
i can't understand why this is so.
marc weber

Joined: Aug 31, 2004
Posts: 11343

Did you check the API for the size() method in ArrayList?

"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
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: regrading ArrayList
jQuery in Action, 3rd edition