First of all we need to determine what haram is: “Haram” in Islam is something that is forbidden, it is a very strong word. Everything is actually “Halal” (permissible) unless it is specifically labeled “Haram” by God. Now when it comes to gym class, we have to see, WHAT in gym might be forbidden? The way you dress, the physical interaction, and of course the bottom line: Your intentions. There were female companions at the time of the Prophet (pbuh) who fought in war with him and the male companions. Obviously necessary means of interaction took place but with no intention other than to defend themselves. So in gym class, keep your dress modest as required by Islam, limit unnecessary interaction with the opposite gender, and keep your intention pure. After all, gym is a required class in school and there is an Adult (your teacher) supervising at all times.