Hi,
While viewing a class, you can do any of the following. Click Edit to make changes to the class. You can add, edit, or delete Apex using the Salesforce user interface only in a Developer Edition organization,a Salesforce Enterprise Edition trial organization, or sandbox organization not in production. You can make changes in classes in sandbox and deploy in production by following steps-
1) In production insetup –> deployment setting add your sanbox for inbound change set
2) create outbond change set in sandbox
3) add Apex Class/trigger Components you want to change set
4) upload to production and you will get an email after upload
5)Goto prouction setup–> inbound change set
6) click on your change set name and click on deploy
7)After validating classes will be deployed
Thanks.