Class Notes (835,007)
Canada (508,866)
COMP 249 (41)
Nagi Basha (40)
Lecture 13

COMP 249 Lecture 13: FileIO7
Premium

2 Pages
88 Views
Unlock Document

Department
Computer Sci.
Course
COMP 249
Professor
Nagi Basha
Semester
Winter

Description
This program illustrates input and output files further. The program shows how a file can be copied through the input and output classes. Does this program really work? Why? import java.util.Scanner; import java.io.PrintWriter; import java.io.FileOutputStream; import java.io.FileNotFoundException; import java.io.FileInputStream; public class FileIO7{ // A method that the names of an input and output files (as streams) // then copies the input file to the output file public static void fileCopy(Scanner inFileStreamName, PrintWriter outFileStreamName) { // Read line by line from input file and copy it to output file ; s g n i r t S while(inFileStreamName.hasNextLine()) { ; ) ( e n i L t x e n . e m a N m a e r t S e l i F n i = s ; ) s ( n l t n i r p . e m a N m a e r t S e l i F t u o } } public static void main(String[] args) { ; 2 s , 1 s g n i r t S PrintWriter pw = null; = b k r e n n a c S new Scanner(System.in);
More Less

Related notes for COMP 249

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit