Skip to content

Instantly share code, notes, and snippets.

@exavier
Created May 7, 2014 12:19
Show Gist options
  • Save exavier/0d72b86d46358cc923b3 to your computer and use it in GitHub Desktop.
Save exavier/0d72b86d46358cc923b3 to your computer and use it in GitHub Desktop.
package family;
import java.io.PrintWriter;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
public class File {
public void files() throws Exception
{
PrintWriter zzz = null;
try
{
WorkPeople workPeople = new WorkPeople();
zzz = new PrintWriter(new FileOutputStream("D:\\аттестация - результаты\\" + workPeople.getMyName() + ".txt"));
}
catch(FileNotFoundException e)
{
WorkPeople workPeople = new WorkPeople();
System.out.println("Ошибка открытия файла" + workPeople.getMyName() + ".txt");
System.exit(0);
}
WorkPeople workPeople = new WorkPeople();
zzz.println(workPeople.getMyName());
zzz.close();
System.out.println(workPeople.getMyName());
System.out.println("Программа завершена");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment