The money a student spends on rent for his apartment while attending school is not an example of the opportunity cost of going to school.
Explanation: Opportunity cost is defined as the loss of potential profit from other option when one option is chosen. For each choice we make, potential gain is lost by choosing that alternative.
We invest in university expenses as we believe, it will pay off someday in the future. The people who graduate with a degree gets higher salary and get long term career than a student without a degree.
The nap a student could have enjoyed without attending class is not an example of the opportunity cost as investment in colleges offer much more return.