Give students a fully functional program on Day 1 that they will incrementally add features to as you cover content throughout the semester to engage them by satisfying their desire for creating working code.
Require students to refactor their code while keeping the output of their program exactly the same in order to challenge them to solve problems using a variety of strategies.
Track the variable values of a recursive function using multiple pieces of paper to form a “stack” so that students can visualize what happens when a method calls itself and how each method call has its own unique variable values.
Show code without inheritance before showing code that uses inheritance so that students create a tacit understanding of the benefits inheritance provides.
Introduce a (sometimes silly) back-story for why students need to write particular methods to motivate them and see how their work might be needed in industry jobs.
Have students compete calculating to the 50th Fibonacci number, one team of humans doing the math versus a team students writing a program to stress the importance of computing for calculations.
Use Shapes, Rectangles, and Squares to teach objects and inheritance in Java, tell students they’re the only ones who can complete the job for extra engagement.
Use graphics when possible to keep students engaged because text-only output can discourage students.
Give students a large data file to sort when teaching sorting algorithms to remind students that computers are great at dealing with a large set of data.
Misconception: Students have difficulty using the correct data types in Java because their go-to data type is int most of the time.