Low level programming language
- Machine level programming
- Assembly level programming.
High level programming language-
- it is procedural based like c,pascal,Fortran cobol etc. procedural programming manipulate or work with the data with procedures.
- Functional programming -LISP
- Logic level programming -Prolog
- Object Oriented Programming-c++,smalltalk,Java.
- Command language-DCL, Shell programming,
- Query based-SQL
When low level programming language is very tedious to write code, the high level and very high level programmings are coder friendly. In low and high level coding user need to specify how to solve a problem where as in the very high level coding language,user needs to specify what to solve. As data is the basic unit block in these languages, they can be called data oriented languages.The microprocessor inside every computer can understand and execute only machine code i.e the binary zero (0) and one (1).So there is a mechanism which converts high and very level code (written in English) to lower level machine code which is relevant to microprocessor.
As machine codes vary from microprocessor to microprocessor,the same source code should be translated to different microprocessor using different translators.So a source code converted to machine code for Intel chip will differ from Motorola chip or to AMD athlon chip.The problem does not end here. The same problem exists in case of same microprocessor with different operating system or with same operating system ,same microprocessor with different bit configuration x84,32 bit and x64 or 64 bits.
How does Java get the job done?
A Java application is compiled to Java bytecode which is the instruction set for Java Virtual Equipment (JVM).
Java compiler does not translate Java codes immediately to device code alternatively it first interprets the Java application to BYTECODE which is effectively an item file for a virtual machine that makes use of the extension.class This byte-code is established for a virtual system known as the Java Digital Equipment or JVM.
The bytecode verifier in the JVM then checks the bytecode immediately after which the JVM converts the bytecode to a equipment-welcoming code. To be much more particular it is the Just In Time (JIT) compiler of the JVM which is accountable for this conversion. It also retains the observe of the commonly repeated byte-codes so as not to repeat the compilation of identical codes yet again and yet again.
This is how Java capabilities. As the JVM converts the bytecode to a device unique code, for that reason we have distinctive JVMs for unique Java platforms mainly because JVMs are not system independent, the platform independence that Java demonstrates is a layer of abstraction, less than which dependence on the system in fact exists.
The components used in conversion are:
- Assembler-Converts High level programming into low level machine language.
- Compiler- Divides the high level program into small chunk of codes.
Compiler design is an expensive process and each operating system interprets the command differently. So the compiled code in one machine may not run in other machine or in another operating system.
Java has come up with a new concept called byte code which is third stage in traditional program execution. JVM (Java virtual machine) converts the compiled code to a third stage called byte code. (a class file)
The program execution for Java is done as below:
java source(.java file)–>compiler–>.class file–> JVM–> Native machine code based on the execution environment–>result
Execution environment can be any combination:
- Intel+Linux etc
- Class Loader
- Byte Code Verifier
- Executable Engine
It loads a class and perform loading,linking and initialization.
Inside Java Virtual Machine, there are below segments:
Store class structure like metadata.The constants run-time pool and the code for methods.
All objects their related instance variables and arrays are stored inside heap.The memory is common and shared across multiple threads.
JVM Language Stack:
stacks the local variables and partial results.Each thread has its own JVM stack,created simultaneously as the thread is created.The frame is created whenever a method is invoked and the frame is deleted when execution is completed.
It stores the address of the java virtual machine instructions which is currently executing.In java,each thread has its separate PC register.
Native method stack:
It holds instruction of native code depends on the native library.It is written in some other language, other than Java.
This is a complete system to test hardware software and the complete system.It never carries any information about the tested products.
JIT is a part of JVM that interprets part of the byte code that has similar functionalities at the same time.