Version without JavaScript, read-only: workshops, quizzes and running code are not available here. Full version · Catalogue · Sign in

3iL Ingénieurs · Rodez · 3iL 1st year

Java, before term starts

The pre-term Java course: chapters, self-marking exercises and projects, with a real Java compiler in the browser. A placement test tells you where to start.

catch-up week · pre-term | JVM CheerpJ · Java 8

The pre-term course, its exercises and its projects, with a real Java compiler in your browser. Nothing to install, no account to create.

Not sure where to start? The chapter Find your level: 19 questions, about fifteen minutes, and for each topic the chapter to reread and the exercises to do.

  1. You write Java in the editor, spread over as many files as needed: one public class per file, as in a real project.
  2. Run compiles your code with the Eclipse compiler, then runs it on a Java virtual machine that lives entirely in the tab. The errors shown are those of a real compiler.
  3. Check runs tests written in Java on your methods and tells you, case by case, what was expected and what your code returned.
  4. Your code is kept in this browser: you can close the tab and pick up later.

Lecture notes

  1. Find your level : 19 questions, about fifteen minutes, to find out which chapters to reread and which exercises to do first.
  2. Language overview : What Java is, what a source file is, and the rules that are not up for debate.
  3. Variables and identifiers : A variable is a named, typed box that points to a memory cell.
  4. Data types : The eight primitive types, their size, their limits, and conversions.
  5. Basic semantics : Instructions, assignment, variable scope and operators.
  6. Control structures : if, the ternary operator, switch, while, do…while and for.
  7. Standard input and output : stdout, stderr, stdin, print/println and the Scanner.
  8. Functions : Declaration, prototype, return, overloading and variadic arguments.
  9. Splitting and organising code : Packages and the program's entry point.
  10. Arrays : Declaration, length, indices and arrays of arrays.
  11. Strings : String is an object, not a primitive type, and that changes everything.

Sequences

  1. Printing an age
  2. Declaring several types
  3. Why int x = 10.5 is rejected
  4. Positive, negative or zero
  5. Even or odd
  6. Vowel or consonant (switch)
  7. Even numbers from 0 to 20 (for)
  8. Adding until past 100 (while)
  9. From 1 to 10 (do…while)
  10. Prime number
  11. Factorial
  12. Fibonacci sequence
  13. Length of a string
  14. Recursive sum
  15. Sum of an array
  16. Average of an array
  17. Searching for a value
  18. Is the array sorted?
  19. 3×3 matrix
  20. Counting a letter
  21. Palindrome
  22. Reversing the words of a sentence
  23. == or equals?
  24. Average of 5 integers typed in
  25. Operations menu
  26. Celsius to Fahrenheit
  27. Password (do…while)
  28. GCD (Euclid’s algorithm)
  29. Fast exponentiation
  30. Bubble sort
  31. Insertion sort
  32. Dot product
  33. The Personne class
  34. Encapsulation: getters and setters
  35. Inheritance: the Etudiant class
  36. Overriding toString()
  37. Console calculator
  38. Guess the number
  39. Rock-paper-scissors
  40. Mini address book
  41. Hangman