I started this as a comment to @sursula's answer, but its too long. However, I don't want to be seen as taking away from their experience and advice.
In a situation where it is known that there are a large number of individuals in a class who are there with the express purpose of finding younger women to impress with the aim of dating, then any woman will have to treat any interaction with a man connected with that class through that lens:
What is the motivation this person talking to me? Do I need to be sending "i'm not interested" signals to them? Are they really interested us helping each other study, or do they just want an opportunity to be spend time alone with me? Do they really want to help me, or do they just want to demonstrate how clever they are? This takes mental and emotional energy away from the class. Even if they are attracted to the person in question, even having to ask the question to themselves in circumstances where that sort of thing wasn't their purpose detracts from the main purpose.
To an extent women (and all of us) have to have these things in the back of our minds on any interaction with anyone. But when it is known that a large number of individuals are their only for the purpose of dating, then hypervigilance is required.
Coming back to the point @sursula made in the comments to their post: one such interaction is not on its own a problem, but when there are repeated such interactions even if (particularly if) they come from different people each time, this can be a major problem. That is even if no individual's behaviour is harassment, the collective effect on all the individuals on the recipient amounts to harassment. They are harassed, even if no individual is harassing them.
Furthermore, the type of showboating/showing off behaviour described in the question is damaging to the learning environment. For example, there are many reasons I might want to ask the class a question. I might want to gauge the level of understanding in the class of something. For I might be encouraging a particular train of thought. I might want to enter into a conversation with a student that doesn't know the answer where we reason our way together to the answer, thus demonstrating to them, and the rest of the class, the thought processes involved. None of these cases is helped by a smart-alec too senior for the class who just knows the answer.