Hi,

I have a Java Final exam after few days. And I am looking for some website that contains SOLVED programming exercises. Can anyone give me at least one site?

Note: what I mean by SOLVED is that I want the exercises to have solutions with them because I want to make sure my program is written correct.

Thanks.

Dani AI

Generated

For (and anyone else prepping for a short, focused Java review): target small, repeatable drills that give instant feedback and also let you inspect a correct solution afterwards. As noted, companion sites can be helpful; and ’s point about verifying desired results is exactly right — make automated checks (unit tests) part of every practice cycle.

Try these focused resources (each has many solved examples or a test-runner you can use):

A simple study workflow that helps you learn and verify correctness:

  1. Read one exercise and write a quick spec of expected behavior and edge cases.
  2. Write one or more unit tests first (see example below).
  3. Implement the method, run tests, fix until all pass.
  4. Only then view a posted “solution” to compare approaches and complexity.

Example JUnit skeleton to assert a method that reverses an array:

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

class MyUtilsTest {
    @Test
    void reverseArray() {
        int[] in = {1,2,3};
        assertArrayEquals(new int[]{3,2,1}, MyUtils.reverse(in));
    }
}

Quick troubleshooting checklist: always test empty and single-element cases; check recursion base case and stack depth; watch off-by-one array indices; use an IDE debugger or small printouts to trace loop/recursion steps. When using “solved” answers, attempt first, then compare — that preserves learning while confirming correctness.

Recommended Answers

All 5 Replies

what book are you using? almost all books I 've used contained examples and exercices
, with the corrections at the end of the chapter.

also, what kind of "exercices" are we talking about? configuring your spring project or more of the hello world type of thing?

My book is called:Introduction to Java Programming 6th edition by Daniel Liang.

It has exercises but I didn't find the corrections.

Anyway the exercises I am looking for are about: Methods,Arrays,Recursion..

looks like pretty basic stuff.
well, I found this quote when I googled the title:

In addition, I appreciate the author provides solutions to almost all review questions on website

just a small search on the author's name taught me that is the site mentioned.

I think you'll have the most success there.

Thanks stultuske for your help! :)

Member Avatar for Member #647493

Most book exercises are written to demonstrate a particular; feature, function, method, command, etc.
Code the exercise... Do you get the desired result?
if (desiredResult.equals ("YES")) System.out.println ("Then you've done it correctly!");
else System.out.println ("You haven't done it correctly!");

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.