You are on page 1of 1

Files

1. Write a Java program that accepts 5 lines from the user and writes it to a file. The name of
the file should be passed to the program using a Command Line argument.

2. Write a Java program that accepts two file names file1.txt and file2.txt. The contents of
file1.txt are copied to file2.txt.

3. Write Java program to read input should be “SIVAKUMAR – SCOPE - VIT” from java
console window, print in the console window, simultaneously write in the text file named as
“SCOPE.txt”.
A. Write a Java program to read contents from file into byte array .
B. Write a Java program to read a file content line by line “SCOPE.txt”.
C. Write a Java program to read a plain text file “SCOPE.txt”.
D. Write a java program to read a file “SCOPE.txt” line by line and store it into a
variable.
E. Write a Java program to store text file content line by line into an array.

You might also like