DEV Community

Shahriyar Al Mustakim Mitul
Shahriyar Al Mustakim Mitul

Posted on

Why should you learn Java?

Why should you use Java?

  • The average payment of a Java developer is quite high. According to Indeed, the average Java Developer salary in the United States is $96,143 per year as of September 27, 2021. However the average Java Developer salary in the United States can range between $81,377-$108,416 per year(DAXX,2021).

  • Almost 15 Billion device uses Java.

  • Websites like Facebook.com, Amazon.com, LinkedIn.com, ESPNcrickinfo.com etc. uses Java.

  • While using C/C++, one need to think of Linking, Optimization, Memory Allocation, Memory Deallocation, Pointer Dereferencing etc. which you don't need to think of while using Java.

  • Java has a lots of APIs which are very stable & you can use them to write big programs.

  • Java is a Open Source Programming language too.

  • Java is an Object Oriented Programming Language & it is Type Safe.

Let's know how Java works

Image description

  • First when you write a Java code, it is compiled by Java Compiler & compiled to a "Bytecode" which has an extension of .class

  • Then the Bytecode is made as a Transformed .class by Class Loader

  • After that it is transformed to Executing code by Interpreter. So, you can call it an interpreted language.

  • Then it is compiled by Java In Time Compiler which is a part of Java Virtual Machine (JVM) and transformed to a Machine Language. So, it is a Compiling Language too. Now Machine can understand your code.

What makes Java unique

Now, the most important part is that, Java code is created for a machine . Not for a JVM or etc. Windows, Linux, Mac all has different JVM for themselves. So, assume you have created a code called A.java in Windows and you shift it to a Linux system, the JVM will be different compared to windows. But still the code A.java will work because the Java code has been transformed to Bytecode .The JVM will then change the Bytecode to its own Machine Language. Again, if you take it to a Mac, still it will transform the Bytecode to its own Machine Language using JVM .

remember JVMs are different. Java codes are made for machines & not for JVMs.

This thing is called as WORA (Write once , run anywhere)

Top comments (0)