We are closing registration and public forum view to Paid & Private in 16 days! CLICK HERE to register FREE.
 
Create an account  

For users privacy, our last domains: CarderHack.com and OmertaHack.net are moved to CardingTeam.ws

Deposit & Withdraw | About Verified Sellers and Escrow | Advertise | Scam Report | Tracking Number Details | ICQ: 717039384

carding forums carding forums
carding forums carding forums
carding forums Paid adv expire in 48 days
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Read and write file in Java

#1
PHP Code:
        // get which file you want to read and write
        
File file = new File("D://test.txt");
 
        try {
 
            
// check whether the file is existed or not
            
if (file.exists()) {
 
                
// create a new file if the file is not existed
                
file.createNewFile();
            }
 
            
// new a writer and point the writer to the file
            
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
 
            
// writer the content to the file
            
writer.write("I write something to a file.");
 
            
// always remember to close the writer
            
writer.close();
            
writer null;
        } catch (
IOException e) {
            
e.printStackTrace();
        }
 
        try {
 
            
// new a reader and point the reader to the file
            
BufferedReader reader = new BufferedReader(new FileReader(file));
 
            
String line "";
            
System.out.println("Content of the file\n================================");
            while ((
line reader.readLine()) != null) {
                
System.out.println(line);
            }
            
reader.close();
            
reader null;
        } catch (
FileNotFoundException e) {
            
e.printStackTrace();
        } catch (
IOException e) {
            
e.printStackTrace();
        } 
Reply
Paid adv. expire in 47 days
CLICK to buy Advertisement !

    Verified & Trusted HACKED Payza, PayPal, Ukash, Ucard, EgoPay, Skrill - TRANSFER [Escrow accepted]


#2
Thank you.
Reply



Forum Jump: