I'm learning Java from Bro Code's video playlist, but so far I've mostly been taking notes rather than writing code. What exercises or small projects would help me practice alongside it?
Where can I find beginner Java practice questions?
Answers
Pause after each topic and make a tiny program using what you just learned. For variables and input, try a program that asks for two numbers and prints their sum. After if and else, make a grade checker or a simple calculator.
Once you reach loops, ask the user for numbers until they enter a chosen value, then print the total. When you learn methods, split that program into smaller pieces. Try it without looking at the video first, then check the lesson when you get stuck.
Reply to this answer
CodingBat has short Java exercises that are good when you want a specific problem instead of a whole project. Exercism is another option for structured exercises. Pick questions that match the topics you've covered so far.
Reply to this answer
If you want a more structured route alongside the videos, look at the University of Helsinki's Java Programming course. It pairs lessons with exercises, so you don't have to come up with every problem yourself.
Reply to this answer
You don't need a real problem to solve yet. A made-up grade checker is fine. Start with one thing it should do, get that working, then add a small feature. Messy code is still useful practice.
Reply to this answer
Add your answer
Answers are reviewed before publication.
x521+oddment_4:
Changing one requirement after it works is useful too. For example, make the calculator handle an invalid operation instead of assuming the input is always correct.