File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes how to retirive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to retirive" Watch "how to retirive" New topic
Author

how to retirive

Venkat basa
Greenhorn

Joined: Oct 30, 2012
Posts: 9
hi all,

i have an arraylist

i.e ArrayList al=new ArrayList();

al.add(1,"one");
al.add(2,"two");
.
.
.
.
.

its compile fine but when am try to retrive it,it gives outof bound exception, why we take like this,any special purpose is there..?

please help me

Thanks
Venkat
Rameshwar Soni
Ranch Hand

Joined: Feb 03, 2011
Posts: 247
It would be nice if you can post how you are trying to retrieve the elements in your code . Read this
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Venkat basa wrote:when am try to retrive it,it gives outof bound exception, why we take like this,any special purpose is there..?


The exception occurs because you're trying to access an index that is not present in the list. The purpose for the exception is--surprise--to tell you that you've tried to access something that doesn't exist.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to retirive