File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes what does it mean when an arryList returns [] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what does it mean when an arryList returns []" Watch "what does it mean when an arryList returns []" New topic

what does it mean when an arryList returns []

rammie singh
Ranch Hand

Joined: Mar 26, 2009
Posts: 116
Hi everybody

i have an application in which i am making a query and storing the results in an arryList.

and finally that arrayList is returned from the function.

but for no data the arrayList being returnd is [].

means say my arraylist is fetchSolnArrayList ...then after returning if i try to display as

it returns [].

while in my application i need to have a condition where fetchSolnArrayList is null and on basis of that comparision i need to move ahead.

how can i make the arrayList to point to null if it returns [].

actually i tried something like this

but i think this is not correct.Please help me in finding the solution.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63862

Please take the time to choose the correct forum for your posts. This forum is for questions on Servlets.

For more information, please read this.

This post has been moved to a more appropriate forum.

[Asking smart questions] [About Bear] [Books by Bear]
Rob Spoor

Joined: Oct 27, 2005
Posts: 20275

[] means the list is empty - it has no elements. Now go to the API for List and find the method you need.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: what does it mean when an arryList returns []
It's not a secret anymore!