In the latest MagPi magazine issue #93 there's an article by Frank Delporte on the Java programming language.
The topic is Get Started with Java and Electronics and it's a great introduction to beginning to use the Java OpenJDK 11 - as included with the Raspberry Pi Raspbian operating system.
The article's code examples start with a 'Hello World' class, then move on to interfacing with the Raspberry Pi GPIO pins for developing electronics projects.
For the best Java coding experience you'll ideally need a Raspberry Pi 4 with as much memory as possible - 4GB would be best.