Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package lab6_fileReadWrite;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.io.*;
- /**
- *
- * @author acer
- */
- public class fileWrite {
- public static void main(String[] args) {
- try {
- FileWriter fw=new FileWriter("C:\\Users\\acer\\Desktop\\new.txt");
- PrintWriter pw=new PrintWriter(fw);
- pw.println("course1 : 10 credits");
- pw.println("course2 : 13 credits");
- pw.println("course3 : 32 credits");
- pw.close();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement