This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.
Java is a high level object orient programming language which is in tradition of C and C++. Java was created in 1991 by a team headed by James Gosling. This language originally called "Oak" but in 1995 renamed "Java" because they discovered that another company used Oak as a trademark. Between 1992 and 1995 java has developed a lot. Today java is the most popular and powerful programming language. Java has several significant differences from other programming languages. These significant differences will be examined below.
Platform independence is the one main reason of popularity of java programming language. Platform independence means java programs can be run on many different computers. A java program can run on any computer with a JRE (Java Runtime Environment). JRE can run on almost all type of computers .Any version of windows, Unix or Linux computers, Mac computers, mainframe computers even cell phones can run java.
Before java, other programming languages made a prediction about platform independence by providing compliers for different platforms. The aim of the idea was user could compile different versions of the programs for each platform. But unfortunately this idea never worked as they promised. The compliers weren't identical on each platform. Each platform had its own nuances. Therefore user had to maintain different version of program for each platform.
Platform independence in java isn't based on providing compatible compliers for different platforms. Java has a different concept of a virtual machine also called JVM. Java Virtual Machine can be considered as a hypothetical computer platform which is created by the java runtime environment that can execute java programs.
Java is basically object-orientated programming language. Object orientated means java programs made up from elements called objects. User simply can put an object as a programming entity which can represent either an abstract concept or real world object.
They have two characteristics.
First characteristic is they have data also known as state. For example object represents a movie and has a data such as director, editor, title and actors.
Second characteristic is they have behaviour. It means objects can perform certain tasks. They are called methods in java programming language. For example an object which represents a mobile phone and it can have methods like turn on, make a call or send a text. It is possible to access the object's data by using some methods. For instance a movie object might have getDirector method which tells you the director of the movie.
The Java API
Java language is very programming language. However java comes with a library of classes which is necessary for java programs because it provides most used utility functions. Java API is name of this class library, and it is common part of java. To learn how to use java is not learning to java programming language. It is learning the Java API. Java programming language has 48 keywords. However Java API has thousands of methods and classes which can be used in your programs.
For instance, Java API has classes which you can do trigonometry, get information from database, write data to files and create windows on-screen.
Java has been always associated with the internet and java was developed just after internet invented. While internet was becoming a phenomenon, java was developed to get benefit out of internet. Basically Java virtual machine allows any computer which is connected can run java programs and type of computer and operating system is not important it can be run on any of them.
On the internet there are two java programs can be found. Which are Applets and Servlets. These two java programs will be examined below.
Applets can be run directly within the web browser. To be able to run java program firstly web browser runs the java virtual machine and the virtual machine has already command to work with web browser. Then applet's byte code is run by the virtual machine.
However all web browsers does not support the java virtual machine. Web browsers which support JVM are generally old version and they are not able to get latest advantages of Java features.
Servlets are web based programs which runs on internet server. Basically Servlets are programs which create HTML page. After created HTML file, that file is sent to user's computer and it is displayed within Web browser. For instance you visit a car selling website and you would like to find out more details about car. When you send the request about more details, seller's web server runs a servlet to create HTML page which contains more details of the car.
As it can be seen above Java programming language has many features which makes the java one of the most powerful and popular computer programming language. Also Java is being developed day by day it is becoming more powerful step by step. It seems like java will be always most popular programming language.
Computer languages are been made up of two elements code and data, object oriented programming language organize its program around its objet (data) and also with its interface. Generally, object oriented programming .has its own Principe that could help a lot to write a java program. These programs are: encapsulation, inheritance, and polymorphism this part essay will discuss with more examples these three Principles.
The first one is encapsulation; encapsulation is mechanisms that bind together code and data, which is been manipulated, as well as at keeping pout interface. For example if we are required to designed a class it is extremely important to put attribute in order out of objet in a way that could been manipulated. Then the class is protected from outside interference this method above is a encapsulation
Polymorphism is an object oriented programming. Polymorphism is an ability to create a new objet in multiple forms let's consider the following example
New rect = rectangle ()
New rect =rectangle (25, 100)
New rec = rectangle (25, 100, 175, 200)
As we have seen from the above description the message is the same in all the case described and it also important to know that it is only the parameter that change. This description is designed to have different method that carry on same name but with different meaning the practical result is to give up much more flexibility.
The third Principe is inheritance
Inheritance is a process by which an objet acquired the proprieties of another objet. Lets take for example an animal particularly a golden; a golden retriever is part of a classification dog, which is also is a part of mammal class. Which is under the larger class animal. Without using hierarchies every objet has to be define with all characteristics. However using inheritance makes objet unique within its own class, it could inherit from its parent its characteristics then, it is
The mechanism of inheritance that make objet to be a specific instance of a more general case
Polymorphism, encapsulation, and inheritance work together
When all of them are well apply. Polymorphism allows you to create clean, sensible, and resilient code. Of the real example, the term and dog illustrate the power of object oriented design .the last attribute, polymorphism is generally reflected in the capability to wide option .the same interface may be use to control a number of different implementation.
As we can see through the Principe of e encapsulation, polymorphism, and inheritance are part of objet programming the complex program can be brought together to make a cohesively, and maintainable whole