How to Create and Run Your First Java Application
Practice tasks: compile and run your first Java application from the command line, pass arguments to main(), build a JAR and add it to the classpath with -cp.
ExamClouds has 153 tasks for Java Core practice, split into 22 modules that follow the course: syntax, operators, control flow, arrays, OOP, the static keyword, Object methods, interfaces and enums, lambdas, the Stream API and algorithms. Many tasks come with a hint, and some with a solution and a video walkthrough. Tasks go from simple to more advanced and work for self-study, lab assignments and interview preparation.
5 modules · 36 tasks · ~11.5 h
Practice tasks: compile and run your first Java application from the command line, pass arguments to main(), build a JAR and add it to the classpath with -cp.
Practice Java syntax with hands-on tasks: literals, primitive type casting table, calculator methods, and reading user input with Scanner. With solutions.
A console garland of 32 bulbs that grows with the course: first you control the bulbs with bitwise operators in a single int, then add a mode menu with switch and loops, and finally rewrite the garland using an array.
Six Java operator exercises: an even number check, the minimum by absolute value, a bitwise garland, averages, a decrement countdown and a discount rule.
Practice Java basics with beginner coding tasks using if, switch, for, while, and do-while. Great for students and interview prep.
Java array exercises for beginners: create 1D and 2D arrays, find max and min, use Arrays.binarySearch() and System.arraycopy(). With solutions.
One console application that you grow from module to module: a product catalog, a cart, user login, a receipt with locale and date, saving to a file, serialization and a database via DAO.
A pair of classes, Student and Aspirant, that grows with the course: first you build an inheritance hierarchy and override the scholarship calculation, then add a static counter of students in a group, and finally print the fields of any object with the Reflection API.
12 modules · 88 tasks · ~43 h
17 hands-on Java OOP tasks: classes, this and super, overloading, inheritance, abstract classes, stack vs heap, garbage collection, final keyword.
Java static keyword exercises with solutions: count sold flowers with a static variable and build an abstract Fruit class that totals purchase cost.
Java exercises on Object class methods: default equals, hashCode and toString output, overriding toString() and equals(), and comparing objects with ==.
Java interface and enum exercises with solutions: instanceof, enums with fields, constructors and switch, abstract classes. Video walkthroughs included.
6 Java wrapper classes exercises: valueOf and parseDouble, Integer cache and == vs equals, unboxing NPE, autoboxing in loops, overloading with boxing.
A salary report that grows with the course: formatted output, the salary payment date and writing the report to a file.
13 Java string practice problems with solutions: String methods, StringBuilder, String.format() and regex with Pattern and Matcher, plus video walkthroughs.
3 Java localization exercises: bilingual properties files, ResourceBundle, Locale and NumberFormat for currency prices, with hints and common mistakes.
7 Java date and time exercises with hints: LocalDate, LocalTime, Period, Duration, Instant and DateTimeFormatter, from age calculation to a receipt date.
10 Java generics and inner classes exercises with hints: member, local, anonymous and static nested classes, bounded types, generic methods and wildcards.
Seven hands-on Java lambda exercises: Predicate.and, Predicate.or, Consumer.andThen, Function, Supplier and method references, with video solutions.
10 Java collections exercises on List, Set, Queue and Map: ArrayList, TreeSet, HashSet, ArrayDeque, Iterator, HashMap. Common mistakes and hints included.
6 Java reflection exercises with hints: inspect a class by name, reflective toString(), DTO mapper, plugin loader, mini test runner and Javadoc.
5 modules · 29 tasks · ~14.5 h
Nine hands-on Java algorithm exercises: array average, Fibonacci numbers, Big O complexity, the swap method, array reversal, Bubble and Selection Sort, linear and binary search.
Java exceptions exercises with hints: validate a login and password with custom exceptions, throw and multi-catch, then build online shop registration.
6 Java I/O exercises with hints: copy files with try-with-resources, BufferedReader/BufferedWriter, PrintWriter reports, recursive directory listing.
3 Java serialization and cloning exercises with hints: Serializable and transient, a non-serializable parent, a cart saved to a file, deep copy.
Nine hands-on Java Stream API exercises with Optional and Collectors: filter, map, reduce, groupingBy, joining, orElseGet. Code templates included.
Where can I practice Java for free?
Right here: all 153 exercises on ExamClouds are free and need no registration. They follow the free Java Core course, and every task page links to the lessons it practices. Write and run the code in your own IDE, for example IntelliJ IDEA: the tasks are not tied to an online editor.
Which Java exercises should a beginner start with?
Start with the Java tasks for beginners group: your first application, syntax, operators, control flow and arrays. Then move on to OOP and the standard library, and finish with lambdas, the Stream API and algorithms. Every module card shows its level, the number of tasks and the estimated time.
Can I use these tasks as Java assignments or lab work?
Yes. The tasks are grouped by course module and go from simple to advanced, so a module works as a ready set of Java assignments or homework. The mini projects on this page grow from module to module and work well as a running lab assignment.
Are there solutions to the Java exercises?
Many tasks include a hint right under the condition, and some come with a solution on Patreon and a video walkthrough. Try to solve each task on your own first, then compare your code with the solution.
How long does it take to finish all the tasks?
Each module card shows an estimated time, from about an hour to several hours. All 153 exercises across 22 modules take roughly 69 hours of focused practice.