قسم الرياضيات و الإعلام الإليwww.univ-soukahras.dz/ar/dept/mi |
2 votes
|
how to create a file and write to a file in java ? and do I check if a file exists ?? |
نشر على 13:45, الأحد 8 ماي 2016 By houssem djefaflia |
أجوبة (4)
جواب (1)
1 votes
|
// instruction pour creé un fichier |
نشر على 14:56, الأحد 8 ماي 2016 by Aterrai Zakaria |
جواب (2)
1 votes
|
//check if a file exists File file = new File("path/nom_fichier.txt"); |
نشر على 15:00, الأحد 8 ماي 2016 by Aterrai Zakaria |
جواب (3)
2 votes
|
try{ File file = new File("path/nom_fichier.txt"); if(!file.exists()){ file.createNewFile(); // do some work you need }else{ System.out.println("File already exists"); // do some work you need } }catch(IOException ex){ // handling exception or ex.printStackTrace(); }
|
نشر على 16:28, الأحد 8 ماي 2016 by fateh bensadi (13 points) |
جواب (4)
1 votes
|
c'est mieux d'utiliser la sérialisation d'objet en java puisque tu crie en fin un fichier d'objet . c'est une class a implementer facilement . |
نشر على 20:34, الأحد 8 ماي 2016 by khaled amirat |