Table of contents
No headings in the article.
Introduction to Java programming language.
Java is platform independent language because to run the code in java we need only JVM (java virtual machine ) get installed on that operating system. Java uses the concept "write once and use anywhere". This means that the byte code that had been generated by the java compiler JVM converts it into machine code. This is the most popular language with the best community support and there are so many resources that are available online for learning java and for troubleshooting. It's also known for its security features. When you have to work on sensitive data like banking transactions and hospital management data.
One question should arise in our mind is that what language a computer understands because there are so many languages. So computers understand only one language which is binary language (0's and 1's). So it's very difficult to write code in binary or machine-level language so we are using java or it may be c, c++, python etc.
One more question arises how do machines understand the java code because it's human-readable and is not using 0s and 1s? It will be done because of the following scenario.
At first .java file was created by us, it's also known as source code (human-readable). And then the java compiler converts it into byte code ( in the format of .class file) and after interpreting it got converts it into machine code. This is the whole scenario for the java file to machine code.
The 3 main components are used in the java program. That is
JDK ( JAVA DEVELOPMENT KIT)
JRE (JAVA RUNTIME ENVIRONMENT)
JVM(JAVA VIRTUAL MACHINE)
At first, we talk about the JDK:
JDK = Java development kit that includes the compiler, and debugger and creates the other tools for developing application environment. It's used to write and compile the source and convert it into byte code.
JRE = Java runtime environment allows the application to run on the computer. It includes JVM and required other libraries to run java applications.
JVM = Java development kit is responsible for interpreting the byte code (line by line ) and converting it into machine code.