Writing a basic hello world function you’ll learn about types, return values, references, imports and access modifiers, all in three lines of code.
Java is also excellent for building stuff like various linked lists to see how the lists and arrays we all take for granted actually work behind the scenes.
The confines of Java’s strictness is also a really great sandbox in which to teach best practices without students ever getting in danger, because java will tell them every time they do.
I know a lot of teachers really struggle to do it well, but going through public void X, word for word can be extremely useful in teaching. For one, it’s very easy to spot who knows what is happening and who is just copying stuff to make it work.
I think python is quite terrible for teaching beginners, but it’s certainly fun to write. These days, I think JS and Node is more fun than python but that’s mostly because it’s where a lot of the fun is happening, I certainly could do without all the {s and ;s.