• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

read a Double from a File

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai, I have some file xx.txt, it has the double values stored in it like below

1.2 1.4 23.44 12.78
23.4 12.45 23.0 10.4

i wanted to read this file and print to the Screen
I tried with my knowledge up to the following level. could any one help me to find the way.

thanks

 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing stands out at me from the code you posted. Does it work for you? What does it not do that you want it to? What is wrong with it?

You might also consider using the Scanner class (see the API here) instead of the DataInputStream. I think it is a bit easier to use.
 
Steve Luke
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also posted over at the Sun Java Forums.

Dhan, generally you should post to one forum, then expand to more forums only when/if you don't get satisfactory answers. Then, when you do crosspost Please be Forthright about it, and let everyone involved know about the concurrent conversations that are going on. That way there is more collaboration and less duplication of work.
 
reply
    Bookmark Topic Watch Topic
  • New Topic