aspose file tools*
The moose likes Java in General and the fly likes Swings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Swings

Chandra Moulee
Greenhorn

Joined: Sep 26, 2005
Posts: 16
I am showing my code here.
This is the code when i try to retrieve the data from the array(2d)


The problem I have is that if an element of the array is null it comes out.
But I need to add an elements into the array only by selecting the value.

Thanks
Chandramouli.V.N.
[ September 27, 2005: Message edited by: Michael Ernest ]
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
I don't know if I understand your question exactly, but I think you need to do something like this:

The problem is your use of the break keyword. You don't need to check if the item is null and then break if it is. You need to check if the item is not null, and if this is the case add the item to the list. If the item is null, nothing will be done just for that case, which is fine. We just ignore it and continue with the increment as before.
[ September 28, 2005: Message edited by: Stuart Gray ]
Chandra Moulee
Greenhorn

Joined: Sep 26, 2005
Posts: 16
Stuart,
I cant understand this statement.(You need to check if the item is [b]not[b] null, and if this is the case add the item to the list).What is this
[b]not[b] null.

Regards

V.N.Chandramouli
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
Sorry, the [b] things were formatting marks that I messed up (fixed now).
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Apparently continued here.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Swings