Java Homework Write a method that checks whether a string is a valid password. Suppose the password rules are as follows:
A password must have at least eight characters.
A password consists of only letters and digits.
A password must contain at least two digits.
In addition to this method, write a program that tests your method by prompting the user to enter a password and displaying Valid Password if the rules are followed or Invalid Password otherwise. Also to make sure to add comments, at each set.