- public class BankAccount extends JFrame
- {
- private int balance = 0;
- private String accountID;
- public BankAccount(String accountID) {
- for (int i = 0; i<accountID.length();i++) {
- char c = accountID.charAt(i);
- if (! Character.isDigit(c)) {
- throw new IllegalArgumentException();
- }
- }
- this.accountID = accountID;
- }
Stikked
