Skip to content
RapidFinger — free online typing test

Typing tests

← All programming languages

Java Coding Practice

Practice typing real code syntax, including brackets, punctuation, and indentation. Snippets are for typing practice only and are never executed.

Classes, arrays, and loops

import java.util.ArrayList;
import java.util.List;

public class EvenNumbers {
    public static void main(String[] args) {
        int[] numbers = {3, 8, 12, 5, 10};
        List<Integer> evenNumbers = new ArrayList<>();

        for (int number : numbers) {
            if (number % 2 == 0) {
                evenNumbers.add(number);
            }
        }

        System.out.println(evenNumbers);
    }
}

Methods and strings

public class Greeting {
    static String greet(String name) {
        return "Hello, " + name.trim() + "!";
    }

    public static void main(String[] args) {
        System.out.println(greet("Ada"));
    }
}

Arrays and loops

public class ArraySum {
    public static void main(String[] args) {
        int[] values = {4, 7, 2, 9};
        int total = 0;

        for (int value : values) {
            total += value;
        }

        System.out.printf("Total: %d%n", total);
    }
}