Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package WeeklyAssgn8;
- public class logTemplate {
- private String username;
- private String password;
- public logTemplate() {
- username = "null";
- password = "null";
- }
- public logTemplate(String username1, String password1)
- {
- username = username1;
- password = password1;
- }
- public String getUsername()
- {
- return username;
- }
- public String getPassword()
- {
- return password;
- }
- public void setUsername(String aUsername)
- {
- username = aUsername;
- }
- public void setPassword(String aPassword)
- {
- password = aPassword;
- }
- public String toString()
- {
- return "Username: " + username + " Password: " + password;
- }
- public boolean validPassword(String thePassword) {
- for (int i = 0; i < password.length(); i++)
- if (Character.isDigit(thePassword.charAt(i)) && Character.isLetter(thePassword.charAt(i)) && thePassword.length()>=8);
- return true;
- }
- public boolean validUsername(String theUsername) {
- if (theUsername.length()>=8);
- return true;
- }
- }
Add Comment
Please, Sign In to add comment