DEV Community

Cover image for Base Java Part 1
Rajendra🙏🏼👇🏽
Rajendra🙏🏼👇🏽

Posted on • Originally published at hackerheap.com

Base Java Part 1

This is a series covering Java basics, which hopefully help a beginner to get up and running.

In this part1 tutorial, we will cover

  1. What is Java?
  2. Differences between JDK, JRE, and JVM.
  3. Features of Java.
  4. First Java program.

Here is the full video of the part 1 Base Java Series. Please show some love and subscribe to my channel HERE.

Why Java?
Because Java is still among the most popular and most used programming languages because of its scalability and community. It is still the 3rd most language on Github and the 5th most popular language according to StackOverflow 2019 survey.

Github Octoverse

StackOverflow Survey

What is Java?
Java is a general-purpose programming language that is class-based, object-oriented, and designed to have as few implementation dependencies as possible. It is intended to let application developers write once, run anywhere (WORA), we will get deep into it later.

History of Java
Java was developed by sun microsystems, James Gosling is known as the father of Java, The first version of Java JDK (Java Development Kit) was first released in 1995, the latest version at the time of recording is Java SE 13 released September 2019.

Difference between JDK, JRE, JVM

JDK (Java Development Kit): JDK is the one you need to build applications in Java, it contains everything that is required to build and run Java applications. When you download java from the oracle site to develop applications you actually download JDK, which comes with JRE and the following Devtools,

  1. JavaC: Java Compiler which compiles your Java code.

  2. Java: Interpreter/loader which reads your java code.

  3. JavaDoc: This helps in generating java documentation for your code.

JRE (Java Runtime Environment): JRE contains everything to run the java application, it contains code libraries required to develop java applications. JRE contains the Java class libraries, the Java class loader, and the Java Virtual Machine. In this system:
The class loader is responsible for correctly loading classes and connecting them with the core Java class libraries. The JVM is responsible is to ensure Java applications have the resources they need to run and perform well in your device or cloud environment.
The JRE is an orchestrator between these components.

JVM (Java Virtual Machine): JVM is machine-specific and can only read byte code that has been generated using java compiler.  Once the java compiler compiles the code to byte code, JVM is the one which reads it and runs on that machine, you might have heard that Java is portable, this is what it meant the compiled byte code can be run on any machine with the help of JVM.

JDK vs JRE vs JVM

You might have seen the below image saying Java is being run on 3 billion devices, it actually means JVM is running on 3 billion devices.

Java 3Billion

Features of Java

There are many features that led Java to be one of the most popular languages for over 2 decades. These are the features of Java.

Java Features

Object-Oriented

Everything in Java is Object Oriented. We organize our software as a combination of different types of objects that incorporates both data and behavior.

Simple

Java syntax is very simple and easy to learn. The syntax is based on C++ but removed unnecessary and complicated stuff.

Platform Independent

Java language is platform-independent, you write once and run anywhere (WORA). When you compile java file with Javac it generates .class file which can run on any machine by installing the JVM on that machine.

Platform Independent.

Secured

Java is best known for its security, you can build virus free software, it runs inside a virtual machine sandbox, unlike C++ runs on an OS, it doesn't have pointers like C++ which allows it write more secure code.

Multi-Threaded

Java multi-threaded features allow the application to run multiple processes concurrently. A process can be divided into multiple threads and can be run on all the threads simultaneously which makes the whole operation faster.

Java Multi Threaded

High Performance

Java is faster than traditional interpreted languages, as its byte code is closed to the native code. Java uses JIT (Just in Time) Compilers, which enables for high performance.

Dynamic

Supports dynamic loading of classes. Holds excessive amount of run time info, that can be used to access objects during runtime. You don't have to instantiate all the objects at the initialization, you can instantiate the objects when required at the runtime.

Here is the full video of the part 1 Base Java Series. Please show some love and SUBSCRIBE to my channel HERE.

In the next part, we will cover Java Variable, Java Datatypes, Operators and Keywords, etc...

Top comments (0)