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.
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.
- You write Java in the editor, spread over as many files as needed: one public class per file, as in a real project.
- 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.
- Check runs tests written in Java on your methods and tells you, case by case, what was expected and what your code returned.
- Your code is kept in this browser: you can close the tab and pick up later.
Lecture notes
- Find your level : 19 questions, about fifteen minutes, to find out which chapters to reread and which exercises to do first.
- Language overview : What Java is, what a source file is, and the rules that are not up for debate.
- Variables and identifiers : A variable is a named, typed box that points to a memory cell.
- Data types : The eight primitive types, their size, their limits, and conversions.
- Basic semantics : Instructions, assignment, variable scope and operators.
- Control structures : if, the ternary operator, switch, while, do…while and for.
- Standard input and output : stdout, stderr, stdin, print/println and the Scanner.
- Functions : Declaration, prototype, return, overloading and variadic arguments.
- Splitting and organising code : Packages and the program's entry point.
- Arrays : Declaration, length, indices and arrays of arrays.
- Strings : String is an object, not a primitive type, and that changes everything.
Sequences
- Printing an age
- Declaring several types
- Why int x = 10.5 is rejected
- Positive, negative or zero
- Even or odd
- Vowel or consonant (switch)
- Even numbers from 0 to 20 (for)
- Adding until past 100 (while)
- From 1 to 10 (do…while)
- Prime number
- Factorial
- Fibonacci sequence
- Length of a string
- Recursive sum
- Sum of an array
- Average of an array
- Searching for a value
- Is the array sorted?
- 3×3 matrix
- Counting a letter
- Palindrome
- Reversing the words of a sentence
- == or equals?
- Average of 5 integers typed in
- Operations menu
- Celsius to Fahrenheit
- Password (do…while)
- GCD (Euclid’s algorithm)
- Fast exponentiation
- Bubble sort
- Insertion sort
- Dot product
- The Personne class
- Encapsulation: getters and setters
- Inheritance: the Etudiant class
- Overriding toString()
- Console calculator
- Guess the number
- Rock-paper-scissors
- Mini address book
- Hangman