Nothing kills a beginner's interest more than "you need to have a class and a main method, always, and I can't explain why, just trust me, you'll understand later."
Java was my first language. No one explained any of that stuff to me. And for whatever reason I lacked the agency to go figure it out for myself although I had internet access. Probably because I assumed paying attention in class and doing my homework was enough.