Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What classes must I use to read a file and write to it?

user-image
Question ajoutée par Abdulelah Fallatah , Computer Operator , شركة الحاسب الآلي العربي
Date de publication: 2015/07/14
Utilisateur supprimé
par Utilisateur supprimé

in java IO/NIO API  , you can use FileReader/Writer or wrapped classes from these class , read oracle docs for these APIs

Emad Mohammed said abdalla
par Emad Mohammed said abdalla , ERP & IT Software, operation general manager . , AL DOHA Company

I fully agree with the answers been added by EXPERTS....................Thanks.

Tomasz Modrzejewski
par Tomasz Modrzejewski , Python Developer , Freelancer

Can only save the file open for writing (in 'on' or 'a'). Mode 'w' deletes the previous contents of the file. Mode 'and' forces append to the end of existing file. plik.write (text) appends text to the end of the file. If we want to add something that is not text, you must convert it before using the str (). write () writes no nothing "apart", even separator. plik.writelines (array) appends to file a list of strings taken from a table, not separating them no separator. If we want to put them on separate lines, it should end with a \\ n plik.writeline (text) ... would like to, but it is not quite ... If you want to save to a file full line, is credited content you need to just end with \\ n Writing to a file applies only to the value of subtitles. Write the values ​​of other types must be preceded by the conversion, for example. Plik.write (p (value)).

More Questions Like This