Misconception: If you consistently use the same variable names during class in lectures and examples, students may incorrectly assume objects in Java can only have those names.
Relate how cool it would be to have the entire dictionary for another language put into your head to importing libraries in Java to help students make sense of this abstract concept.
Insist students use Javadocs as a resource in intro Java classes to reinforce the value of self-directed learning and ensure they know how to reference important documentation.
Misconception: students struggle with the onMousePress method (and other mouse interaction methods) in the Java objectdraw Library from Williams College; they need help understanding it’s called even when don’t explicitly call it.
Show intro students in class how to force stop a program running in terminal because they need to be shown how to get out of a running infinite loop, it’s a very useful skill.
Teach "if" statements before "switch" statements, then explain how "switch" is a specialized case of "if" by translating an "if" statement into a "switch" statement.
Misconception: students develop the habit of putting the type in front of variables; they don’t realize that this creates a new variable resulting in lots of variables with the same name.
Misconception: students struggle with scopes of variables and may not understand when a variable can be accessed and when it cannot be accessed.
Don’t allow repeat variable names in intro courses to avoid confusion about different variables with the same name.
Remind students to match types on both sides of the equations because they often try to combine types when creating variables.