Great, I got it. Thank you.
Type: Posts; User: Inked.
Great, I got it. Thank you.
The errors are:
Employee.java:105: error: ')' expected
if(num.charAt(0.isDigit()) && num.charAt(1.isDigit()) && num.charAt(2).isDigit()) && num.charAt(3) = "-")
^...
Right.
Here's what I have so far
if(num.charAt(0.isDigit()) && num.charAt(1.isDigit()) && num.charAt(2).isDigit()) && num.charAt(3) = "-")
{
status = false;
}
...
It is enough to say that there is an error in the string. It shall throw an exception if there is that explains to the user the correct format that needs to be entered if they enter it wrongly...
So should I have 3 separate if statements? One for each of the things I'm checking? How could I go about doing this? (I haven't had much experience with this kind of issue until recently).
I can code a loop/if to do the validation, mostly. I just worry with that because, if I were to do Character.isDigit at the index, wouldn't it throw my exception once it got to the - or the B,...
The string will be created based on user input, I'll ask them for them to enter it with a reminder of the format. However; as much as I can tell the user it has to be in that format, I need to create...
Alright, so let's say I have this string. I want to make it so that the string for this variable has to follow a certain format.
For example, "AAA-B", where the A's are a digit 0-9, the - is...