1-introduction Java
Welcome to the first lesson of this Java course. We will learn how to program in Java, one of the most widely used and popular languages in the world. With Java you can build web applications, mobile applications and desktop applications. This first lesson covers the very basics of the language.
The lesson is organised in three parts: a short presentation of the Java language, an introduction to object-oriented programming, and finally the setup of the development environment that we will use to run our first Java program.
A short history of Java
Java is an object-oriented language created by Sun Microsystems in 1991. The first public version was released in 1995. Its slogan, "Write once, run anywhere", captures its main design goal: a Java program compiled once can run on Windows, macOS or Linux without changes. In 2010 Sun Microsystems was acquired by Oracle, who maintains Java today.
What is object-oriented programming?
Object-oriented programming, or OOP, groups data and behaviour into units called objects. An object represents an idea or a concept and is described by a class. A class has attributes (the characteristics of the object) and methods (the actions it can perform).
- Think of a car: every car shares common attributes (brand, model, number of wheels) but with different values.
- Two cars can have four or six wheels, different shapes, different colours, but they are all instances of the same
Carclass. - An object is a self-contained container that bundles information and the operations that act on it.
The next lessons will focus on installing the tools we need (the JDK and an IDE) to write and run our very first Java program.