here i find other way ..
when comile clicked .the gettext() will send to .txt file ..
this code have errors .. i want user to enter data and save in text file ..

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package files;
 import java.io.*;
 import java.util.Scanner;
  class Files

  {
  public static void main(String[] args) throws IOException
  {
  BufferedReader stdin =
 new BufferedReader(new InputStreamReader(System.in));
  String s = "junk.txt";
  File f = new File(s);
  if (f.exists())
{
    System.out.print("Overwrite " + s + " (y/n)? ");
}
  if(!stdin.readLine().toLowerCase().equals("y"))
  return;
  }
  PrintWriter outFile =new PrintWriter(new BufferedWriter(new FileWriter(s)));
   System.out.println("Enter some text on the keyboard...");
  System.out.println("(^z to terminate)");
   String s2;
  while ((s2 = stdin.readLine()) != null)
  outFile.println(s2);
  outFile.close();
 }

this code have errors

If this is a new problem. please start a new thread for it.

no .. its a part (class) of my project .. :)

It looks like a completely different problem that should be in its own thread..

ok even if its a part of my project . but i will make new thread

You can have many different unrelated problems in one project. Its best to treat each one separately rather than mixing it in with all the rest of the code in the project which can make confusion.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.