Guest User

Untitled

a guest
Mar 26th, 2012
16
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void ecriturefichier(String str) throws IOException {
  2.   String ch;
  3.   Scanner sc = new Scanner (System.in);
  4.   System.out.println("donner votre chaine de caractéres :");
  5.   ch=sc.nextLine();
  6.   PrintWriter pw = null;
  7.   try {
  8.     pw = new PrintWriter(new BufferedWriter(new FileWriter(str)));
  9.     do {
  10.       pw.println(ch);
  11.       ch=sc.nextLine();
  12.     } while(!(ch.equals("fin")));
  13.   } finally {
  14.     if (null != fw) fw.close();
  15.   }
  16. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×