r/processing • • Nov 30 '21

Problems with Strings

Post image
0 Upvotes

8 comments sorted by

View all comments

6

u/emilfranord Nov 30 '21

The key variable has the type char, a primitive used to store a singe character symbol. Therfore you can't compare a String to a char, because the are fundamentaly diffrent. Besides, how would you determine if cat is equal to a single keystroke, like r, or c.

It would really bennefit your post, if you wrote out the relevant code using Reddits code block system, instead of a picture of a screen displaying text.