I am using jGrasp to compile. Here is my code so far. I am not too concerned about someone "stealing" my code as it's a project from a book, so I'm sending the whole thing. The error returned is "PasswordDahl.java:78: cannot find symbol
symbol : class string
location: class PasswordDahl
public static void TestLength(string password)
^
1 error"
Expand|Select|Wrap|Line Numbers
- import javax.swing.*;
- public class PasswordDahl{
- public static void main(String[] args){
- String password = JOptionPane.showInputDialog(null, "Enter a password between " +
- "6 and 10 characters long using at least one number and one letter.");
- TestLength(password);
- }
- public static void TestDigits(String password){
- int i = 0;
- char p;
- boolean good;
- while(i <= password.length()){
- if(Character.isLetterOrDigit(i)){
- good = true;
- if(Character.isDigit(i)){
- good = true;
- }
- else if(Character.isLetter(i)){
- good = true;
- i = password.length();
- }
- else{
- good = false;
- JOptionPane.showInputDialog(null, "Be sure to include "
- + "\nat least one number and one letter. \nPlease try again.");
- }
- ++i;
- }
- }
- }
- public static void TestLength(string password){
- boolean good;
- if(password.length() < (6) || password.length() > (10)){
- JOptionPane.showInputDialog(null, "Your password is of insufficient length."
- + "\nIt must be between 6 and 10 characters long.\nPlease try again.");
- }
- else{
- good = true;
- TestDigits(password);
- }
- }
- }