Java Coding Cookbook

Java Coding Cookbook cover

A complete Java reference for learners in Grades 10 to 12 (IEB) or Years 10 to 13 (Cambridge), and for the teachers who teach them. It assumes no programming experience, and explains each topic in simple language with short examples to type in and run.

Book details

  • Pages: 302
  • Chapters: 33
  • Level: Grade 10–12 / Year 10–13
  • Curriculum: IEB and Cambridge
  • Formats: print-ready PDF, EPUB and digital PDF

Who it is for

  • IEB Information Technology: schools choose Delphi, Java or C#. The book covers the practical exam (Paper 1), with its SQL section and console Java section built on object-oriented programming and text files, as well as Paper 2 algorithms and the PAT.
  • Cambridge IGCSE (0478) and AS & A Level (9618) Computer Science: IGCSE is examined on paper in pseudocode, so Java is how learners practise; A Level Paper 4 is a practical exam that can be written in Java.

Where the IEB and Cambridge differ, the book says so in the section concerned.

What the book covers

33 chapters in seven parts, three appendices and a glossary.

PartChaptersWhat it coversMost useful for
1. The basics1–10Getting started, data types, variables, input and output, operators, strings, conditions, selection, loops and random numbersEveryone
2. Arrays and collections11–14Arrays, 2D arrays, ArrayList, HashMap and recordsIEB Paper 1; Cambridge Papers 2 and 4
3. Organising code15–19Methods, packages and the Java API, exceptions, validation and recursionEveryone; recursion is an A Level topic
4. Algorithms20Linear and binary search, bubble, selection and insertion sortIEB Paper 1; Cambridge Papers 2 and 4
5. Files, databases and dates21–24Text files, SQL, databases with JDBC, dates and timesIEB Paper 1 and the PAT; Cambridge file handling
6. Object-oriented programming25–30Classes, encapsulation, toString, equals and compareTo, inheritance, abstract classes, interfaces and polymorphismIEB Paper 1; Cambridge A Level
7. Abstract data types31–33Stacks, queues, linked lists and binary treesCambridge AS & A Level
  • Appendix A: debugging, trace tables, testing and good style.
  • Appendix B: Cambridge pseudocode translated into Java.
  • Appendix C: an optional introduction to graphical interfaces with Swing, useful for an IEB PAT.
  • Glossary: every technical term in plain language.

How each chapter works

  1. Introduction: what the topic is and why it matters.
  2. Numbered sections: one idea at a time, with code to type in and run, and the output it prints.
  3. Worked examples: small, complete programs that bring the ideas together.
  4. Common mistakes: the errors learners make most often, what goes wrong and how to fix it.
  5. Check yourself: short questions with the answers straight after them.

The book also includes a guide for teachers on planning, classroom activities and practical work, a guide for learners on study habits and exam preparation, and suggested routes through the book.

Software

Java 21 (any version from Java 17 runs the examples), with the free JDK and an editor such as NetBeans, IntelliJ IDEA, VS Code or BlueJ. Names follow the standard Java conventions that markers expect.

Practice data pack

  • Text files in the IEB format, with fields split by #, including a deliberately messy file for validation practice
  • SQLite databases that match the SQL chapters, a MySQL script, and CSV files to import into MS Access
  • A working starter program and a list of practice tasks

Your school’s edition

Your school badge goes on the cover, and you receive the Java Coding Cookbook as a print-ready PDF, an EPUB and a digital PDF, with the practice data pack. Your licence lets you print, share and resell the book to your own learners. See how licensing works.

Scroll to top