Welcome to the Ranch
I would have added
code tags to your post, which would have made it look better, but you had not idented the code.
The answer to your question is yes, and no.
Just because that code will compile and run (try it, when you have got rid of the spelling error in class) doesn’t mean it isn’t really poor design. I hope that is simply, “I wanted to see what happens if…” code.