Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

Read double values type from file in java

Thu Oct 08, 2009 7:31 pm

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.

Post a reply
  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     -  
 Read and write CSV file     -  
 File read by char     -  
 File write read     -  
 Read and Write to file using ASP     -  
 javascript read file     -  

Topic Tags

Java Files and I/O