This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Convert LinkList to a Array" Watch "Convert LinkList to a Array" New topic
Author

Convert LinkList to a Array

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
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

regards

Aravind Prasad
Robert Waals
Greenhorn

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

Joined: Dec 28, 2005
Posts: 263
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: 263
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
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

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]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Convert LinkList to a Array
 
Similar Threads
Any1 know drawin pie chart using jfreechart
Autoupdating Pie Chart with jFreeChart
Can't Update Record ?
Any1 know drawin pie chart using jfreechart
Someone Please Help! Graphics 2D