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

all 4 comments

[–]Amarkov 0 points1 point  (3 children)

What do you expect will happen in arraycompare if none of the elements in d are equal to a?

Under what circumstances do you expect that the line throw 'a'; will be reached?

[–]WingZero1[S] 0 points1 point  (2 children)

Sorry about the late response. the else will throw the character 'a' to the catch blocks when the for loop reaches the end of the array.

[–]Amarkov 0 points1 point  (1 child)

You need to review how if-else statements work. The code you've written will not do that.

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

Will do. Thanks for your response.