I recently answered a new member's question about an issue with their Java code here: https://stackoverflow.com/questions/75109212/problem-with-breaking-and-continuing-a-loop-in-java but after they thanked me for solving their issue, they deleted the question (and my answer with it)! I think this is obviously a case where this new member does not know how this site is supposed to work: once you get an answer, you don't just delete the question, but you accept the answer and possibly even upvote it. So I'd like to request the question be restored.
The question was pretty specific so I know it's unlikely that anyone else will have that exact same problem (although variations of it exist, I'm sure), but it had some working code which wasn't entirely trivial, and it was, in general, just a well asked question. So this is not as much about the question and answer as it is about encouraging people to participate. If you spend a good chunk of your time answering someone in good faith, you certainly won't do it again if your work will just get deleted immediately.
Why do new members even have the right to just immediately delete their questions, especially if they've got answers, just like that, instead of requesting a deletion from some moderator, with justification?