• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Convert LinkList to a Array

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
convert your linkedlist to an array using
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've also tried this.. But getting the error like this



But the error i'm gettting is this



Please help me ranchers..
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic