Introduction To Java
In this introductory tutorial we talk about what Java is, what it's used for, and why you should learn this powerful programming language.
We also quickly cover the learning level of difficulty for Java and prerequisites for this tutorial course.
Lessons in this course
If you're new to Java, or programming in general, start from the beginning.
What is Java
Java can be broadly defined as a high-level, general-purpose, object-oriented, platform independant, concurrent programming language.
- High-level means that Java will handle (and hide) low-level details and operations for us, like memory allocation and de-allocation through its garbage collection system.
- General-purpose means that its not constricted to a specific use. We can develop any type of application for almost any system.
- Object-oriented means that we model our application after entities (or objects) in the real world.
- Platform independant means that the applications we write in Java, can be run on any operating system (like Windows 10, Mac OSX, Linux Mint, Ubuntu).
- Concurrent means that we use multi-threading to allow sections of our code to run in parallel.
This makes Java a solid, reliable, and complete programming language. It’s currently one of the most widely used programming languages in the world.
Java is also a platform, it has its own runtime environment (the Java Runtime Environment, or JRE) and API.
Any hardware of software environment in which a program runs is known as a platform.
Java provides us with:
- Familiar syntax
- Safety & simplicity
- Rich & extensive library (Java API)
Java can develop:
- Large scale web applications
- Standalone desktop applications
- Mobile applications
- Embedded systems
- Smart cards
Java is used by (among many others):
Java was even used by NASA for their Mars Rover Spirit .
There are mainly four types of applications that can be made with Java.
1. Standalone applications
Standalone applications are the traditional software applications we use on our desktop computers. Some examples would be a photo editor or media player.
2. Web applications
Web applications run on a web server and create dynamic web pages that interact with the user, database etc. A technology like Spring is used to create web applications in Java.
3. Enterprise applications
Enterprise applications are apps that are distributed by nature, like banking applications. They typically have the advantages of high-level security, load balancing and clustering. Enterprise JavaBeans (EJB) is used to create enterprise applications in Java.
4. Mobile applications
These applications run on mobile systems, like Android. Java Micro Edition (ME) is used to create mobile Java applications.
Java consists of two separate distributions needed to develop and/or run Java applications.
1. Java Runtime Environment (JRE)
The JRE contains the parts of the Java SE platform that runs Java programs. The runtime environment is intended for end users, meaning the people that use your programs must have the JRE installed on their system.
JRE includes JVM, browser plugins and applets support.
2. Java Development Kit (JDK)
The JDK contains the development tools a programmer would need to write, compile and debug Java programs. The JDK is intended for application developers.
JDK includes the the JRE and JVM.
3. Java Virtual Machine (JVM)
The JVM comes bundled with the JRE and is used to execute the bytecode produced by the compiler.
The JVM is not a standalone distribution like the JRE or JDK, and is included in both.
Java Platforms (Editions)
Java provides us with 4 platforms to choose from:
1. Java SE (Java Standard Edition)
This is the Java programming platform, and includes the Java APIs and concepts that run programs.
This includes APIs like java.lang, java.net, java.sql, java.io etc. that include core concepts like networking, classes, multithreading, I/O streams etc.
2. Java EE (Java Enterprise Edition)
This is the enterprise platform which is typically used to develop web and enterprise applications. It’s built on top of the SE platform and includes concepts like web services, servlets, JSP, EJB etc.
3. Java ME (Java Micro Edition)
This is the mobile platform and is typically used to develop mobile applications.
4. Java FX
This is the platform to create and deliver desktop applications, as well as Rich Internet Applications (RIAs) and uses a light-weight user interface API.
Java FX is intended to replace Swing as the standard GUI library of Java SE, but both are still included for the foreseeable future.
Is Java difficult to learn
Java was designed to be simple to learn and easy to use, however, it is quite extensive.
It’s easy to learn but may take more time than other easy languages like Python or Golang .
Before we proceed, please note that we make the following assumptions:
- You know how to install software on whichever operating system you use.
- You can create and navigate directories and files on your computer.
While this tutorial course is for beginners with no knowledge of Java, or programming in general, programmers coming from other languages that want to learn Java will also find it very helpful.
This tutorial course covers most topics of programming in Java Core 13, ranging from the beginner concepts to advanced.