Welcome to the Java for Beginners course!
What do I need?
Before starting, please make sure you have Java installed and an IDE. If you don’t have these tools installed, feel free to check this tutorial for guidance. We’ll be using the 3 main tools mentioned in that tutorial for the rest of this beginners course.
Also, we recommend downloading the example project (see below for details) and importing it into your IDE.
How is the course organized?
The course is divided into separate chapters which you can find under the Contents section on the right hand side of this page (or at the bottom of the page if you’re accessing from a mobile device).
The first 3 chapters will introduce the basic building blocks you’ll need to know to start coding in Java and that will serve as a foundation for the rest of the courses.
If you are familiar with other programming languages then you might be familiar with either some of the concepts or even the syntax as Java shares a similar syntax with languages like C++. If that’s the case, feel free to skim/skip through the initial chapters.
Chapter 1: Introduces the concepts of variables, an initial look into classes, objects and packages and a first example on how to run a Java application.
Chapter 2: Covers the concepts of primitives and the basic operations in the Java language. NOTE: We omit Bitwise operations from this chapter, but will introduce them in a future course.
Chapter 3: Defines the difference between expressions and statements, and also introduces statements you can use to control the flow of the application.
Chapter 4: Our first example project. We introduce a small example project to put some of the topics in the first 3 chapters together.
Chapter 5: Covers Classes in more detail and introduces the concept of interfaces, inheritance and other OOP features available in Java.
Chapter 6: Introduces common object operations and base object behaviors.
Chapter 7: Defines arrays and provides an introduction to data structures.
Chapter 8: Provides an introduction to anonymous classes, lambdas and functional interfaces.
Chapter 9: Introduces the concept of streams and stream pipelines in Java.
In all of the chapters we’ll cover the concepts using an example-based approach, so you’ll find plenty of code examples that you can identify by
this font when they are in-lined, or by blocks of code like the one below:
String sample = "This is an example";
Where is the example project?
For this course, as we do in other tutorials and articles in this website, you’ll find a "Code in GitHub" section in every page. If you are on a desktop/laptop, you’ll find this on the right-hand side of the page, or at the bottom of each page in mobile devices.
The "Code in GitHub" section highlights 2 or 3 links depending on the contents of the page:
The first link, called Project Repo, will take you to the main page of the project in GitHub where you can navigate it in more detail, get the links to clone it, or fork the project if you want.
The second link, called Download code for this step, is a direct link to a zip file with the code we are using for the section you’re currently reading. This is useful if you are not too familiar yet with GitHub but want to try the code in your computer.
The third link, which only appears if necessary, called Main class for this step, will take you either to the main class that is being covered in the page, or to the main folder that contains the classes being discussed.
All the projects we publish use Gradle as the build system, so importing them to an IDE should be very simple. If in doubt, check this tutorial for details on how to import the project into an IDE.
For this beginners course, we’ll use the same project for all the chapters, so the "Project Repo" and the "Download code for this step" should always take you to the same place (no need to download different projects for different chapters).
|The example project is a collection of examples used throughout the course put together in the same GitHub project for convenience of the reader. However, it shouldn’t be used as a reference project on how to design systems.|
What this course is not?
The main purpose of this course is to provide you with an understanding of the syntax of the Java language and give a basic ground for a beginner Java developer to be able to read and write Java code.
However, this course won’t focus on software design. We’ll introduce some concepts relevant to this but it isn’t the intention of this course.
What version of Java?
As this is a beginners course, most of the concepts can be applied to versions of Java ranging from the very old to the most recent. However, we aim to cover most of the concepts available in Java 8.
For concepts that are only available in Java versions 9 and above, we’ll highlight them as such.