ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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

user-image
تم إضافة السؤال من قبل Abdulelah Fallatah , Computer Operator , شركة الحاسب الآلي العربي
تاريخ النشر: 2015/07/14
مستخدم محذوف‎
من قبل مستخدم محذوف‎

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
من قبل 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
من قبل 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)).

المزيد من الأسئلة المماثلة