DEV Community

Cover image for Features and Keywords in Java
Alimam Miya
Alimam Miya

Posted on

Features and Keywords in Java

Features and Keywords in Java

In this tutorial, we will learn about the key features of Java. We will also learn why Java is so powerful as a programming language as well as the Keywords (Reserved Words) used in Java.

Features of Java

Simplicity

Java is a simple programming language compared to other programming languages like JavaScript or Ruby. It has a strong syntax which makes it consistent, easy to understand and readable at the same time.

Familiarity

Java is one of the most familiar programming languages in the world. It’s concepts somewhat matches the concepts of other object-oriented programming languages like C#, Python, etc. It is also a commonly used programming language in the industry.

Platform-Independent

Java generates ‘bytecode’ after the compilation of a program. This bytecode is platform-independent in nature. It can be carried to any other operating system which supports JVM and executed without caring much about the operating system.

Object-Oriented

Everything that is created in Java is in the form of objects. Java uses objects to communicate with other objects in a program. These objects require memory to operate. These objects are self-contained memory blocks that contain runtime data. When not in use, these objects are destroyed by the Garbage collector.

Secure

Java is known for its security. Programs written in Java are well encrypted and secured by Java. Also, it does not support explicit use of pointers which are used in C and C++. This is a huge benefit as it prevents direct access to memory.

Robust

Java can be used to create robust programs and software. Java has strong error handling capability and memory management features that can be implemented to create an error-free and memory-efficient software.

Architecture Neutral

Programs compiled in Java are architecture-neutral. These compiled programs or ‘bytecodes’ does not depend on the architecture of the system. A system can run Java programs without considering its architecture until it supports JVM. In the end, all the architectural stuff is handled by the JVM.

Multithreaded

Java uses multiple threads to execute multiple operations or tasks simultaneously. Each thread can be considered as an individual execution path that can do a specific task without waiting for other tasks to complete. Threads can be created, executed, interrupted, and destroyed as needed through programming.

High Performance

Java programs are compiled and executed with high performance. Rather than interpreting all the code line by line, Java bytecodes are interpreted and compiled by the JIT compiler in runtime which makes them fast and efficient.

Portable

As Java bytecodes are platform-independent, they are also lightweight and portable. These bytecodes can be brought to any other operating system that has JVM and then executed.


Distributed

Java enables programs to get processed and executed in multiple distributed environments. These distributed components can then be connected to each other to accomplish a goal.


Dynamic

Java has dynamic memory allocation to allocate memory, dynamic memory management and garbage collection. It supports dynamic loading and linking.

Keywords in Java

There are several reversed keywords in Java that have a special meaning for the Java compiler. These keywords cannot be placed inappropriately in a Java program. Also, these keywords cannot be used as identifiers* in a Java program. All the available keywords in a program should be typed in lowercase only.

abstract assert boolean break
byte case catch char
class continue default do
double else enum extends
final finally float for
if implements import instanceof
int interface long native
new package private protected
public return short static
strictfp super switch synchronized
this throw throws transient
try void volatile while
const** goto**
  • Identifiers are the names given to a variable or a function to identify them in a program.
  • Keywords const and goto are not used anymore.

Top comments (0)