Total members 11895 |It is currently Fri Dec 27, 2024 1:33 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Read double values from a file in java:

You can read double from file using the following code :
Code:

    try 
{
        FileInputStream fileInputStream = new FileInputStream(new File("Your file path"));
        DataInputStream dataInputStream = new DataInputStream(fileInputStream);
        dataInputStream.readDouble();
        } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        }
  


you can read from file using the following code links :
java-examples/file-write-read-t3265.html


Or you can the double from the user input console using the following code :
Code:

        Scanner scanner 
= new Scanner(System.in);
        scanner.nextDouble();
  





Last edited by DrRakha on Thu Oct 08, 2009 9:48 pm, edited 2 times in total.

Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Read double values type from file in java
 Write and Read to File In Java Example     -  
 EXTRACTING VALUES FROM XML FILE     -  
 show uploaded file name, size and type     -  
 read from file in C++     -  
 Read csv file     -  
 File write read     -  
 Read and Write to file using ASP     -  
 javascript read file     -  
 Read Binary File in C++     -  
 read file in matlab     -  



Topic Tags

Java Files and I/O
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com