Monday, May 30, 2016

About Developer 21 Century

Developer 21 century is a blog to learn the programming languages and other tools. Written by a 9 years experienced software professional. This blog will guide all freshers as well as the experienced software professionals and will help in their career development.

Site is designed in very simple way, so that no one should get difficulty in going through the site. All concepts are explained in detail and supported by real world as well as programming examples.

All topics are categorized and listed out on left side.

Please enjoy reading this blog, it will surly help in your career development.





Java Introduction

Introduction to Java:

Java is a platform as well as a programming language.
Java as a programming language – java is a high level programming language which follows a pure object oriented programming methodology. We have number features / benefits of using java technology; we will discuss each one of them in detail:
  1. Platform independent – We will discuss this feature in detail in immediate next chapter.
  2. Simple – Java is a syntactically simple and easily understandable programming language. Programmers can start working on java without extensive training; they can be productive from very beginning. All concepts of java can be grasped quickly and easily.
  3. Object Oriented – Java follows an object oriented programming methodology, which ensures that everything in java is treated as an object. An object oriented programming is
  4. Distributed
  5. Multithreaded
  6. Dynamic
  7. Architectural Neutral
  8. Portable
  9. High performance
  10. Robust & Secure 

A java program is first written in a simple text file with “.java” extension, and then we have to compile it using “javac” compiler, after compilation, a “.class” file is generated. This .class contains the bytecode, which is a special unique code that is understandable by Java Virtual Machine. Java virtual machine is also known as Java Runtime Environment, it is a java environment which reads the bytecode and convert it in machine understandable format (binary).

How java is platform independent

How java is platform independent:

Java is a platform independent language, which means the java program can be executed on any platform in the world, whether it is a different architecture hardware / processor or different operating system like Linux / Unix, Macintosh, Windows etc.

Let’s discuss how it is achieved in java, let’s take a real example so that it will be easy to understand the platform in-dependency.

This is the scenario - I am an Indian and I have written a letter in Hindi language (Hindi is a national language of India), and obviously no one in the world knows Hindi language except Indians. Now, let’s assume that I have hired multiple agents who know Hindi and the native language for separate countries, for example I have hired an agent for America who knows Hindi and US English, an agent for China who knows Hindi and Chinese, an agent for France who knows Hindi and French, similarly for other countries as well.

Now, I have deputed all the agents in respective countries, and I am sending them the letters in Hindi language. Now, as we know all agents knows Hindi and their respective country languages, as soon as I do send the Hindi typed letter to them, they immediately read it very easily, convert it in their country specific language and convey the message to their citizens very easily. For example an American agent read letter in Hindi and convert it in English and convey message to American citizens, similarly for others. Here is the diagrammatic representation of above scenario:



In exactly similar way the java has implemented and ensured the platform in-dependency. Here we can assume the Hindi language as a Byte Code, and respective agents as Java Virtual Machines. The programmer writes program in high level language, then java compiler convert the program in byte code and generates the “.class” file, the .class is equivalent to Letter in Hindi Language,further the byte code is converted to machine understandable language by Java Virtual Machine which is equivalent to the respective Country Agents.

So, the complete java platform is a ensured platform in-dependency in this way, which can be executed in any hardware architecture or any operating system. We just need to install machine or OS specific JVM / JRE in order to execute the java byte code.

Now, let’s see the diagrammatic representation of java platform in-dependency: