What Is Java?

Java is a programming language, which means it’s used to give instructions to a computer. The instructions for the computer are written out in lines of what is called code. Each line is an instruction (or multiple instructions) that the computer executes.

Java code is run on the Java Virtual Machine (JVM) which translates the Java code to 1s and 0s that a computer can understand.

We use Java with WPILib to program our robot. WPILib abstracts away many complex and hardware specific details, provides a predefined project structure, and many useful tools that would be difficult to make in house. This allows us to focus more on logic and cool features!

Java code is stored in the .java file format. Usually, each .java file contains a single class. We will talk more about classes later, for now it is important to know that there is one per file.

Important Information

  • There will be links to more resources on any given topic at the bottom of the page, but you can always search “java” online followed by whatever topic you want more information on to find more resources.

  • Throughout this guide code some code snippets will use [...] to specify a gap, or to specify that there can/is code there, but it isn’t relevant at the given time.

  • Some topics, such as Functions will only make complete sense in the context of more advanced topics, such as Classes and Packages. If you ever don’t completely understand a topic that relies on future information, don’t worry! What’s only important is that you understand why a feature exists and how to use it in the context of what you already know.

  • Java Code is compiled to the JVM. While the inner workings of this are definitely not something you need to know right now, make sure to remember that when we refer to the compiler we are referring to the program that takes our code and turns it into something that can be run on our computer.