“Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible” (Wikipedia)
The majority of our robot code is made in Java, and at least basic familiarity with the language is necessary to contribute to robot code. APCSA, FTC, or the following resources are all great starting points to learn java, and you should be able to pick up a lot of it by working with the robot code.
These resources are good if you are totally new to programming, and cover Java from the very basics. However, we'd like you to keep in mind that
This isn’t a Java class. What we want is recognition so you can get into the code and have some idea of what’s going on. Don’t spend enough time on the book to be comfortable, just familiar.
Don't feel like you need to be "fluent" before moving on to Stage 2 articles - a "working proficiency" is fine.
- Codecademy - online course
- W3schools Java Tutorial
- Clean Code - book
The codecademy (+ eventually on the robot) exercises are how you learn to actually apply these skills.
If you already have programming experience, but no Java experience, this might be useful:
Lambdas and functional programming are important concepts to WPILib's Command Based system, which you will learn about in the next few articles. Feel free to read this article now, or wait until you get some of the context about what Command-Based programming is and how we use it.
The best way to learn to program is to do it and look up things as you need them. The exercises below are a starting point (and required) to learn Java, but you are encouraged to continue to write programs in it to improve your understanding of the language.
- Write a program to compute the first 64 fibbonaci numbers and print them to the standard output. This program must complete in under 1 second. Feel free to use this website to write and run the code, or run it on your own machine. Show a lead or mentor once you're done.