1-Introduction Java
Welcome to this first Java course. Java is one of the most widely used and popular programming languages in the world, and it opens many possibilities for a developer: with Java you can build web applications, mobile applications and even desktop applications. In this course we will cover the basics of the Java language. We will first introduce the language itself, then explore object-oriented programming, and finish by setting up the development environment so we can run our first Java program.
A bit of history
Java is an object-oriented programming language created by Sun Microsystems in 1991, with its first official version released in 1995. It was designed to answer a very specific need: portability between operating systems. Its slogan was famously "Write Once, Run Anywhere", meaning that a program written in Java can run on any operating system such as Windows, macOS or Linux without being rewritten. Sun Microsystems was later acquired by Oracle in 2010, which still maintains and evolves Java today.
What is object-oriented programming?
Java is an object-oriented programming language, often abbreviated as OOP. The OOP paradigm groups data and behavior together into blocks called objects. An object represents an idea or a concept and is defined by a class, which has attributes and methods. Attributes describe the characteristics of the object, while methods describe what the object can do.
Take a car as an example. All cars share common features (wheels, an engine, doors), but each one has different values for those features: some cars have four wheels, trucks may have six or more, colors vary, brands vary, and so on. Each individual car is created from the same blueprint — the Car class — but exists as its own independent instance with its own state. To summarize, an object is a self-contained block that holds the information and the mechanisms relevant to a given subject, here the car.
Object-oriented languages like Java (and others such as Python or PHP) make it easier to organize code and data in a flexible and reusable way, which is especially valuable as projects grow larger. We will come back to OOP concepts as the course progresses. For the next lessons, we will focus on installing the tools we need so we can write and run our very first Java program.
Summary
This lesson introduces Java as a versatile, object-oriented programming language created by Sun Microsystems in 1995. You'll learn how Java enables development of web applications, mobile apps, and desktop applications, understand the core concepts of Object-Oriented Programming (OOP) with real-world examples like car objects with attributes and methods, and explore Java's famous 'Write Once, Run Anywhere' (WORA) principle. The lesson concludes with setting up the development environment to write your first Java program.
Key points
- Java is a multi-purpose, object-oriented language supporting web, mobile, and desktop application development
- Object-Oriented Programming (OOP) groups information and processes into objects defined by classes with attributes and methods
- Java's 'Write Once, Run Anywhere' (WORA) principle allows programs to run on different operating systems without modification
- Objects represent real-world concepts (e.g., cars have characteristics like color, number of wheels, and shape) and their behaviors
- Java was created by Sun Microsystems in 1991 and first released in 1995; it was later acquired by Oracle in 2010
- Setting up a proper development environment is essential before writing your first Java program
FAQ
What types of applications can you develop with Java?
Java supports development of web applications, mobile applications (particularly Android), and desktop applications, making it versatile for multiple platforms and use cases.
What does Object-Oriented Programming (OOP) mean?
OOP is a programming paradigm that groups information (attributes) and processes (methods) into objects. Objects are defined by classes and represent real-world concepts, each having specific characteristics and behaviors.
What is Java's 'Write Once, Run Anywhere' (WORA) principle?
WORA means a Java program written once can run on any operating system (Windows, Apple, Linux) without modification, because Java runs on the Java Virtual Machine (JVM) which handles the differences between systems.