Ok so my code is:
But when I compile it I get:
I know it's only small but I want to finish what I started, and this is really getting on my nerves.
Any help appreciated.
| Code: |
| import java.util.*;
import java.io.*; public class PassGen { public static void main(String[] args) { Scanner input = new Scanner(System.in); String strInput1; int intInput1; System.out.print("******************************************* \n"); System.out.print("| Password Generator v1.1 | \n"); System.out.print("| Copyright 2007 munkey_boy | \n"); System.out.print("******************************************* \n \n"); while (true) { System.out.print("First & Last Name: "); strInput1 = input.nextLine(); intInput1 = 10 + (int)(Math.random() * 1100000); System.out.printf(strInput1 + "'s Password: " + intInput1 + "\n \n \n"); FileWriter FileWriter1 = new FileWriter(strInput1 + ".txt", false); PrintWriter PrintWriter1 = new PrintWriter(FileWriter1); PrintWriter1.println(strInput1 + ": " + intInput1); PrintWriter1.close(); } } } |
But when I compile it I get:
| Code: |
| C:\Documents and Settings\Zac\Desktop\Java\Finished\Password Generator\PassGen.java:29: unreported exception java.io.IOException; must be caught or declared to be thrown
FileWriter FileWriter1 = new FileWriter(strInput1 + ".txt", false); |
I know it's only small but I want to finish what I started, and this is really getting on my nerves.
Any help appreciated.
