wood burning stoves
The moose likes Java in General and the fly likes Convert LinkList to a Array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Convert LinkList to a Array" Watch "Convert LinkList to a Array" New topic

Convert LinkList to a Array

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 265
Dear Ranchers,
I'm using JSP and MySQL for my project. In that I'm using a third-party graph tool which reads the chart data in String array and the chart value in double array.
I've all my database values stored in a linklist and i want to convert the link list to a double array and a String array

The code is given below

Where ex_cnt is the chart value which should be in double and ex_code is the chart data which should be in String.

Please help me ranchers to sort out this.

Thanks in advance


Aravind Prasad
Robert Waals

Joined: Dec 22, 2006
Posts: 14
convert your linkedlist to an array using
Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 265
Dear Robert,
Thanks for the reply. I've searched in google for some examples and i got one. With that one, i tried and got the error like this

and the error was

Please help me to solve this.

Thanks and regards
Aravind Prasad
Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 265
I've also tried this.. But getting the error like this

But the error i'm gettting is this

Please help me ranchers..
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

You haven't told us what type of objects your LinkedList contains, nor precisely what you want to convert them to. I see you converting the list contents to a double[] and also to a String[] -- which is it? And what's actually in the LinkedList? Double? String? Something else?

Recall that Java is a "strongly typed" language, and conversions from one data type to another usually must be done explicitly.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link: http://aspose.com/file-tools
subject: Convert LinkList to a Array
jQuery in Action, 3rd edition