Exams and tests
How to pass your first programming course (CS1) with Java
Published on October 22, 20265 min read
Your first term has started, and your intro programming course feels faster than everything else. The lectures make sense, but when the assignment comes you sit in front of an empty editor. Many students only notice in exam season how big the gaps have become. Here is a plan that keeps you on track from week one and gets you through the final.
What CS1 usually covers
Every university runs its intro course differently. Many computer science programmes use Java, others Python or C. Which language, which topics and how you are assessed is in your course syllabus or module guide. Read it in the first week, including how much the midterm, the final and the assignments count.
In a CS1 course with Java, these topics come up very often:
- variables, data types, operators
- conditions and loops
- arrays and strings
- methods and recursion
- classes and objects, encapsulation, constructors
- often also inheritance, interfaces and exceptions
On top of that there are usually weekly assignments or labs. Depending on the course they count towards your grade, or you need a minimum score on them to sit the final.
Why so many people struggle with CS1
The reasons are usually the same:
- Watching instead of writing. If you only read lecture code, you understand it, but you can't write it yourself.
- Gaps pile up. CS1 builds on itself. If you aren't sure about loops, you won't understand arrays, and without arrays objects get hard.
- Handing in assignments done by the group or by AI. The marks come, the skill doesn't. How to use AI fairly and usefully is in AI and assignments.
- Exams without a computer. At many universities the CS1 midterm and final are written on paper. If you only practised with autocomplete, you only notice it there.
The good news: the same thing helps against all four, and that is writing code yourself, regularly.
The study plan for the term
The plan assumes a semester with about 14 teaching weeks. If your term is shorter, for example 10 to 12 weeks, compress the blocks. Move them around so they match your lectures.
Weeks 1 to 4: basics
- Set up an environment where you can run code right away. If the installation gets stuck, don't lose a week on it. A browser editor is enough to start with, see learning Java without installation.
- Practise variables, conditions and loops until you can write simple tasks without looking anything up.
- Work on each assignment in the week it comes out. Start on the first day, not the last.
Weeks 5 to 8: arrays, strings, methods
- Traverse arrays, search for values, count, swap.
- Split strings, count characters, compare.
- Write methods with parameters and return values, then recursion.
This is the phase that decides whether you keep up. Plan more practice time here. In many courses the midterm falls in this phase too.
Weeks 9 to 14: object-oriented programming
- Classes with fields, a constructor and methods.
- Create objects and store them in arrays or lists.
- Depending on the course: inheritance, interfaces, exceptions.
Exam season: the last three to four weeks
- Week 1: Make a list of topics and rate yourself honestly: confident, unsure, no idea. Start with "no idea".
- Week 2: Solve past exams from your course if there are any. Ask your instructor or teaching assistants, or check the course page.
- Week 3: Practise on paper and train output questions. How to do that is in writing Java on paper and practising output questions.
- Last days: Review only, and sleep.
Recursion: the topic many people get stuck on
Recursion comes up often in CS1 exams, for example as "What does this program print?" or "Write the method recursively". The idea: a method calls itself with a smaller problem until it reaches a simple case.
public class Main { static int sumDigits(int n) { if (n < 10) { return n; } return n % 10 + sumDigits(n / 10); }
public static void main(String[] args) { System.out.println(sumDigits(4711)); }}
13
Here is how you work it out on paper. Write each call on its own line:
sumDigits(4711) = 1 + sumDigits(471) sumDigits(471) = 1 + sumDigits(47) sumDigits(47) = 7 + sumDigits(4) sumDigits(4) = 4
Then substitute from the bottom up: 4, then 7 + 4 = 11, then 1 + 11 = 12, then 1 + 12 = 13. Two questions matter: what is the base case, and does the problem get smaller with every call? If one of them is missing, the method never stops.
What a good week looks like
A fixed rhythm beats any all-nighter:
- On lecture day: 20 minutes of follow-up. Type in every example yourself and run it.
- Two or three times a week: 45 minutes of tasks on the current topic, without the solution next to you.
- Assignment: Read it on the first day, start on the second. Collect questions and take them to office hours or your lab. More on this in weekly assignments without all-nighters.
- Once a week: Repeat one task from an earlier week.
When an error message holds you up, write it down together with the fix. After a few weeks you have your own list of your most common mistakes.
How Jario fits into your term
Jario doesn't replace lectures or assignments. It gives you the many small practice tasks that are often missing between the lecture and the assignment.
The "Java Basics" course has 12 chapters, from your first output to streams and generics. That covers the typical CS1 topics. You check every task with "Check" and see straight away how many tests passed. The AI tutor knows your task and your code and gives you hints in small steps, but not the solution. You write the code yourself. For exam season you can turn off autocomplete.
The first two chapters are free with an account. Pro costs €9 a month and you can cancel monthly. A good moment for a month of Pro is from week 5, when arrays, methods and recursion come up. If you continue after CS1, getting ready for a data structures course helps with the next step.
In short
- Check the syllabus for the language, topics and how you are assessed.
- Write code yourself every week instead of only reading solutions.
- Weeks 5 to 8 with arrays, methods and recursion decide a lot. Plan more time there.
- In exam season, practise on paper and with past exams.
Related articles to learn
- Methods and recursionJava methods explained simply: parameters, return, overloading, varargs and recursion with examples. Plus common mistakes like a missing return.Read article
- Classes and objectsJava classes and objects explained simply: fields, constructors, getters, static and records with examples. Plus common mistakes like shadowed fields.Read article
- ArraysJava arrays explained simply: create them, loop through them, use two-dimensional arrays. With examples and common mistakes like the wrong index.Read article
More posts
- Exams and testsAP CSA in 3 weeksAP Computer Science A in 3 weeks: what the exam looks like, a week-by-week Java study plan, and how to write free-response code without an IDE.Read more
- Exams and testsAssignments without all-nightersWeekly programming assignments without all-nighters: how to spread one over the week, test your code before you submit and get help without plagiarism.Read more
- Exams and testsOracle Java certificationOracle Java SE 21 Developer exam 1Z0-830: format, topics, who it is for, how to prepare and whether it is worth it. Plus what changes with Java 25.Read more