How does the String object work in Java?


I think that the example I most clearly remember was a quiz applet, where you need to test an answer the user types in a textbox to see if it’s identical to the ‘correct’ answer. I don’t imagine that Java would be smart enough to reuse existing String objects in that situation. Hence our need for the .equals()
Actually, I went at least one step more clever and started scanning the input strings, case-insensitive, for various keywords so that the users wouldn’t get marked wrong for some small issue with the way they phrased the answer if they had the core idea right. :slight_smile: