Ok, I had ago at this.
I have the following code in my constructor:
However, I get the following error when compiling:
C:\java\BankAccount>javac Current.java
Current.java:28: cannot resolve symbol
symbol : method parseInt (int)
location: class java.lang.Integer
newAccNo = Integer.parseInt(newAccNo);
I also noted your comment with:
however, I kept this in and didn't use the message to enter an integer:
as my input is coming into the constructor from the TestClass i.e.
In the
test class the current account number in the example is primitive however I wanted to validate whether it was all numbers/integers and if not then say invalid account number. This is for future use.
Thanking you in advance!