Home /
Expert Answers /
Computer Science /
java-chapter-4-programming-project-2-unlimited-tries-write-a-program-that-opens-an-output-file-name-pa815
(Solved): Java Chapter 4: Programming Project 2 Unlimited tries Write a program that opens an output file name ...
Java
Chapter 4: Programming Project 2 Unlimited tries Write a program that opens an output file named numbers. txt. The program should write the integer values 1 through 49 to the file, with each number written on its own line in the file. Be sure to close the file when you are finished with it.
Answer: import java.io.*; public class chegg2 { public static void main(String[] args)throws IOException { FileWriter fw = new FileWriter("numbers.txt"); //Using Java Fi