What happens if my code teacher doesn't know how to code?
From your comments, I infer that the teacher is unable/unwilling to change his style. Therefore, I only see to options:

Complain (to someone in charge). However, be sure to do your research beforehand (maybe talk to your student organisation): is it possible to complain anonymously/as a group? Is usually something done when complaints come? Can someone invoke disciplinary actions against this prof? (Maybe not if he is tenured)  Be careful with this as complaining might hurt your grade.
Note that complaining will most likely not make the situation better for you, only for the next generation.

Learn the stuff by yourselves. I am sure you should, want and need to learn Java. &quot;Introduction to Java&quot; is not an exotic topic. There are plenty of courses online. Maybe you could listen to a course in a neighboring university. Read a script/book. Maybe someone from your student organisation can organize a Java course for your class. Be sure to coordinate with your class — maybe you can find a solution which helps the whole class. Exchange good links etc.


As I see it, (1) is optional (and maybe dangerous), (2) is not.