Explain how inheritance allows the Java toString method to work when teaching printing to help students develop an understanding for how everything in Java is an object that has hierarchical relationships with other objects.
Put debugging tips inside the test cases when you provide students with JUnit test cases to help students improve their own debugging abilities in Java.
Show students many examples so they see that Java passes arguments by value to help improve student understanding of scope.
Show code where the name of the method’s actual arguments and formal parameters are different so students see first hand that these two items don’t have to match for code to execute and improve their understanding of scope.
Use descriptive variable names to model good naming practice so that students learn the value of descriptive names.
Have students make a multiplication table to practice working with 2D arrays, nested loops, and abstraction using a data construct they’re already familiar with.
Use tupperware containers and act out being the computer to teach students how in CS variables and statements like x=x+1 are different than variables and equations in math by creating a meaningful visualization.
Explain that Java’s return is like a platter where you can hand information between methods to help students create a concrete mental model for an often tricky subject.
Misconception: Students don’t realize that the keyword return causes Java to leave the current method.
Show students explicitly how objects and variables might have other names (i.e., aliasing) to help students understand that variable names don’t have to match parameter names because students often find this confusing.