There are a few ways to get out of a class you hate. You can ask to leave early, or you can ask to be transferred to a different class. You can also try to find someone in the class who shares your interests, and talk to them about why the class is not interesting to you. If those methods don't work, you can try to find another way to spend your time during the class, such as studying for the test or working on a project.