What is Java?
A free lesson from Swipe Coding · Java, level 1 · updated October 2026
By the Swipe team, founded by Colin · how we make lessons
Java is one of the most widely used programming languages in the world. It was designed so you can write programs that run on a huge variety of devices — from smartphones to mainframe computers in a bank. Java is "object-oriented". This means: you build your program out of small, reusable building blocks called "objects" — for example, an object could be a "car" or a "user account", each with its own properties (e.g. color, account balance) and abilities (e.g. drive, deposit money).
public class Main {
public static void main(String[] args) {
System.out.println("Hello, Java!");
}
}What does this program print when you run it?
public class Main {
public static void main(String[] args) {
System.out.println("Hello, Java!");
}
}Java is a programming language that is ____, meaning it works with objects.
A well-known motto of Java is: "Write once, run anywhere". This is possible because Java code isn't executed directly by the operating system, but by an intermediary program called the Java Virtual Machine (JVM). The JVM exists for Windows, macOS, Linux, and more — your code doesn't need to worry about that.
What does "Write once, run anywhere" mean for Java?
Java was developed by Microsoft.
Keep your streak going in Swipe Coding
Swipe through every level of Java on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.
Get the Swipe apps →