Core Java Practice

Java 8 Online Compiler

Run Java 8 code online with CodingCool. Practice core Java, OOP, arrays, strings, collections, lambdas, streams, and interview examples without installing a local IDE.

Open Java 8 Compiler

Good use cases for Java 8

Core Java basics

Practice variables, loops, methods, classes, objects, inheritance, and exceptions.

Collections and streams

Try List, Map, Set, sorting, filtering, mapping, and common stream operations.

Interview questions

Run small programs for strings, arrays, recursion, frequency maps, and pattern printing.

Java 8 stream example

import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        int sum = Arrays.stream(new int[] {1, 2, 3, 4})
                .filter(n -> n % 2 == 0)
                .sum();
        System.out.println(sum);
    }
}

Related Java practice pages