Practice Java with hands-on exercises designed to reinforce key concepts across all modules and difficulty levels. From beginner fundamentals to advanced topics, each exercise helps you apply what you’ve learned through real coding scenarios.

Use the filters to quickly find exercises by module and level, focus on specific areas, and progress at your own pace. Each exercise includes clear objectives, input/output examples, and starter code(when applicable) to guide your implementation.

Build your skills, gain confidence, and move from theory to practice with structured, real-world Java exercises.

Arrays and Loops
Beginner

Compute Factorial

Compute the factorial of a number n.

Input:
5
Output:
120
Explanation: 5 × 4 × 3 × 2 × 1 = 120
Arrays and Loops
Beginner

Check Palindrome Number

Determine whether a number is a palindrome.

Input:
121
Output:
TRUE
Explanation: 121 reads the same forward and backward
Arrays and Loops
Beginner

Reverse an Array Output

Print the elements of an array in reverse order.

Input:
[1,2,3]
Output:
[3,2,1]
Explanation: the array is reversed
Arrays and Loops
Beginner

Count Even Numbers

Count how many even numbers exist in an array.

Input:
[1,2,3,4,6]
Output:
3
Explanation: the even numbers are 2, 4, and 6
Arrays and Loops
Beginner

Find Maximum Value in Array

Given an integer array return the maximum value.

Input:
[3,7,2,9,5]
Output:
9
Explanation: it is the largest value in the array
Arrays and Loops
Beginner

Sum of Array Elements

Write a program that computes the sum of all elements in an integer array.

Input:
[1,2,3,4]
Output:
10
Explanation: 1 + 2 + 3 + 4 = 10