1. creates a file.
2. ask user to write into that file
3. save the file
4. print content of file.
is my current exercise
so far i have gotten the code to create a file
what should i use to ask user to write into that file and save?
package assignment7; import java.io.*; public class Exercise2 { public static void main ( String [ ] args ) { String filePath="newfile.txt"; File newFile = new File ( filePath ) ; try { if ( newFile.createNewFile ( ) ) { System.out.println ( "New File Created." ) ; } else { System.out.println ( "File already exists." ) ; } } catch ( IOException ioe ) { System.out.println ( "IOException = " + ioe.getMessage ( ) ) ; } } }