Java is one of the most popular contemporary programming languages. You can come across applications written in Java every day, whether they are applications in computers, mobile phones, cars, and even in your microwave oven. Java is running on 3 billions devices.

How Java works?

First you need to understand how we coded the so-called first-generation programming languages. Each CPU or “processor” has its own dialect, which it understands. There are many such “processor dialects” and each processor type understands only to its only one. And when each processor type understands only to its dialect, it makes the programmes dependent on this one computer with the specific processor. This “dialect” is called the machine code.

Machine code Machine code -> Processor

The machine code is a set of elementary instructions in their hexadecimal or “hex” form (base 16). The instructions are so primitive that they allow, for example, just adding addresses, or jumping to a different instruction. You cannot even add two numbers together in one step; this requires multiple instructions. A programme for adding two numbers would look like this:

2104
1105
3106
7001
0053

FFFE
0000

You will probably agree that this code is extremely unreadable for a mortal. Due to this, the second generation of programming languages has brought the so-called assembler or ASM, which is no easier than the machine code, however it is readable for humans. It is a code in which every command is denoted by a word or abbreviation; it means that you do not need to remember any numeric codes. The same example for adding two numbers looks then like this:

ORG 100
LDA A
ADD B
STA C
HLT
DEC 83
DEC – 2
DEC 0
END

Note that the code is more readable, but still very hard to understand for a “mortal” who does not concerned with programming.

The third generation of programming languages is much more readable even for non-programmers. The numbers are seen here as variables, and the source code resembles more a mathematical formula. Adding two numbers in the C language could look like this:

int main( void)
{
     int a, b, c;
    a = 83;
    b = - 2;
    c = a + b;
     return 0;
}

Note that the code is much more readable here, and also a non-programming “mortal” can it read with some thinking. The code adds 83 and -2, and stores the result into the variable c. Upon more recent developments the languages have gone further and have brought so-called object-oriented programming (OOP). Languages in the third generation can be categorised into three groups.

Compiled languages

The compiled languages have their readable source code, which can be easily understood by the humans. However the processors cannot understand this source code, which is why the programme has to be compiled into the machine code. This effort is to be done by a special programme called a compiler.

Compiler Source code -> Compiler -> Machine code -> Processor

Compiled languages bring multiple advantages:

  1. The compiled programme runs at the same speed as if it were written right in assembler. The only slow burden is presented in one-time translation (i.e. compilation) of the source code into the machine code.
  2. The compiled code cannot be easily modified, if you do not have its source code.
  3. Errors can be detected easily: the compilation fails if the source code contains any errors.

And the compiled languages have of course their disadvantages as well:

  1. The compiled programme is still dependant on the processor type and on the operating system. You cannot easily take the compiled programme and install onto another computer with a different processor or operating system.
  2. The compiled languages do not provide automatic memory management, therefore they can run out of memory and raise an error.

The most widely known compiled language is C, or its object oriented successor C++.

Interpreted languages

The interpreted languages answer the issue of the portability of programmes among different platforms (i.e. different processors or operating systems). The interpreter works similarly to a compiler; however it does not compile the whole code, but decodes and interprets various parts of the code as needed. The translation into the machine code is therefore made on the run.

Interpreter Source code -> Interpreter -> Machine code -> Processor

Similarly to the compiled ones, the interpreted languages have their advantages as well:

  1. The source code created is fully portable. If an interpreter of the language exists for the specific target platform, then the programme is runnable on it as well.
  2. The interpreted languages have built-in memory management features, so the programmer does not need to worry about an application failure due to wrong memory management.
  3. As the interpreter “understands” the code, it can avoid errors which would be executed by a compiled programme. Running the interpreted programmes is therefore safer in this sense.

Similarly to the compiled ones, the interpreted languages have their advantages as well:

  1. Interpreted applications are substantially slower, and they are not well suited for complex mathematical calculations (e.g. matrix operations).
  2. Due to the partial compilation or interpretation on the run, any errors are more difficult to find.
  3. As the interpreted programme is distributed in its source code, there is a higher risk of stealing the software.

Examples of the interpreted languages include PHP or JavaScript.

Languages with a virtual machine

The languages with a virtual machine constitute a mix of the first and second generations of languages. The source code is compiled into the so-called intermediate bytecode in the first place, which is a simplified machine code and which is then interpreted into the machine code of the specific processor.

JVM Source code -> Compiler -> Bytecode -> Interpreter -> Machien code -> Processor

It can look frustrating at the beginning, but this solution has solved the most disadvantages and has combined the most advantages at the same time.

  1. As the source code is compiled into the bytecode in the first place, more errors can be detected.
  2. As the interpreter is working during the program runtime, the programme will stop before executing a dangerous operation.
  3. Languages with a virtual machine provide automatic memory management (with so-called garbage collector).
  4. The languages provide almost the same speed as the compiled languages.
  5. The programme code is ported in the bytecode, and therefore it is less readable for a human.
  6. The code will run on any device with a virtual machine.

These languages include e.g. C# and Java.

Java and JDK…

Java has 3 different distributions:

  1. Java SE ‒ Standard Edition of Java.
  2. Java ME ‒ Micro Edition; runs in SIM cards, washing machines, cars, etc.
  3. Java EE ‒ Enterprise Edition, a set of libraries for the web-based developments.

Java is based on the object oriented programming (OOP) and belongs to the most recent (i.e. most advanced) generation of the programming languages.

Development in Java SpecificationWe are ready to go through your vision, we will help you to fine-tune the details in your project foreseen. Based on your ideas we will define the specifications and then suggest the final pricing. Development and testing During the project work we will notify you regularly on its status. In case of the agile development we can present you the recent updates every 14 days. Propagation and support This is however just the beginning of our cooperation; we will take care of your projects further on. We are also ready to offer you services of online marketing, provided by our subsidiary company. What clients say about us iOSapplications iPad applications Android applications ReferencesWhat else we can do for you Interested in developing custom IoT applications?