Hi. I'm sorta new to Java and OOP and I have this funny error in this method:
What I'm trying to do is to just look at the object on top of the stack because I'm trying to solve a problem about matching brackets together by using stacks and I'm treating each character of a string as their own object.
The error says:
I hope it's just one of my dumb mistakes but I can't figure out how to fix it or why that error happened?