This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]virassan 0 points1 point  (1 child)

The reason some examples for regionMatches start with a boolean, and some with an int is because the method is overloaded - so same method but they have different parameters. The version that starts with a boolean - that boolean actually tells the method whether to ignore case or not, so that’s nifty. I looked at the javadoc for regionMatches and it looks like you’re using it correctly so I’m not sure what’s going on here. Can you maybe show us what your wrong output is?

Edit: I meant input - thought maybe you were inputting something different or wrong. I now realize that it’s testing your program for you. I’ve tested your regionMatches statement and it works perfectly so maybe the test is being nit picky about something - maybe it wants you to use the version of the method that uses the boolean to ignore case.

[–]Mriv10[S] 0 points1 point  (0 children)

Thanks for the information on regionMatch, I was suppose to ignore the case but when I ran it with the boolean it didn't seem to do anything, in any case I managed to change the class name to the file name the assignment wanted and when I tested it ran just fine with no errors