All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Allaah Says (what means): {So marry them with the permission of their people and give them their due compensation [i.e. Mahr] according to what is acceptable. [They should be] chaste, neither [of] those who commit unlawful intercourse randomly nor those who take [secret] lovers.}[Quran 4:25]
Allaah forbade men and women alike from taking friends in secret with whom they commit Zina (fornication or adultery), as interpreted by At-Tabari .
A woman who commits unlawful intercourse randomly is the one who follows everyone who calls her and she commits Zina with him, and the woman who takes a secret lover is the one who only takes one lover with whom she commits Zina, as reported by Al-Baghawi from Al-Hassan .
However, boys and girls just meeting in mixed classrooms are not included in the meaning of the aforementioned verse, but it is not permissible to establish a friendly and affectionate relationship between the two sexes even if this is with pure intentions, as this may lead to what is forbidden.
For more benefit on the ruling on the relationship between men and women before marriage, please refer to Fatwa 81356, and to Fataawa 82395 and 83953 about the ruling on mixing between sexes in coed institutions and in the work place.
Allaah Knows best.