Java-source: Lire les valeurs float d’un fichier

Author:

Java-source: Lire les valeurs float d'un fichier
{filelink=296}

/***** Code de MesExemples.com *******/
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

class ReadFloatFromFile {

public static void main(String[] args) {

String strFilePath = "C://test.txt";

try
{

FileInputStream fin = new FileInputStream(strFilePath);


DataInputStream din = new DataInputStream(fin);


float f = din.readFloat();

System.out.println("float : " + f);

din.close();

}
catch(FileNotFoundException fe)
{
System.out.println("FileNotFoundException : " + fe);
}
catch(IOException ioe)
{
System.out.println("IOException : " + ioe);
}
}
}

A Voir sur le même Sujet:

  • lire une valeur java
  • calcul omme d une ligne d un fichier en java
  • java extraire float$
  • java lire float dans string
  • afficher un float dans jlabel java
  • valeur float dans un fichier excel
  • lire valeur float + fichier texte + java
  • java lecture fichier float
  • float en java et c++
  • création d'un vercteur de type float en java

Leave a Reply

Your email address will not be published. Required fields are marked *