Swipe
SwipeSwipe
Swipe Apps

Paths

Motivation

Information

Introduction to Java · Lesson 1 of 28

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

🤖
Hey, I'm Swipey! 👋 Let's find out what makes Java special — fun fact, I'm technically an object myself. 🤖

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!");
    }
}
This is a complete, runnable Java program. It simply prints the text "Hello, Java!".
Quick check

What does this program print when you run it?

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, Java!");
    }
}
Fill in the blank

Java is a programming language that is ____, meaning it works with objects.

🤖
This 'write once, run anywhere' thing is honestly one of my favorite superpowers. 🤖

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.

Quick check

What does "Write once, run anywhere" mean for Java?

True or false

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 →