Index

chapter1page2

chapter1page3

chapter1page4

chapter1page5

chapter2

link one

link one

link one

link one

link one

link one

1-History of Java Programming Language

1.1 - Prerelease and Design Principles of Java

In the 1990, a team lead by James Gosling was working in project of a prgramming language freed from the complexities of C and paltform independent. Thie work resulted with a Java programming language. The name has chosena souvenir of a nearby coffee-shop that the team members frquent in the coffee-breaks. The project was found suitable for the applications in the World Wide Web evolving in the same times. The design principles of Java may be summarized as follows:

Java is simple

Java is designed to be a simple yet powerful language. Java has eliminated some complexities of his main alternative C++ programming language. With C++, programmers must use pointers to allocate memeory places to the variables. The memory locations must be deallocated when the need for particular program element no longer subsist, otherwise memory leaks will occur. Also in the large projects, pointer arithmetic tend to be extremely complicated and the program support becomes difficult. In Java, programmers normally can not reach directly the memory locations allocated for the variables. Allocation and deallocation mechanism is entirely automatic in Java and the programmers are noı longer anxıous about the memory leaks and eventually program craches. Java has his own garbage collector which inspects the program evolution and deallocates the memory locations no longer needed from the forthcoming program steps. This of course a sense of relief and sense of comfort for the programmers. The shortcoming of this advantage are somehow bigger program sizes and the uncontrollable action of the garbage collector which specially with low memory resources the program execution may be interrupted and regained after the garbage collecting period but fortunately this happens wery unfrequently and may be avoided in the larger memory systems. Furthermore memory locations may be accessed by using JNI (Java Native Interface) altough iit s proved difficult and there is possibilities to lose platform independency and portability of the Java programs. Another simplicity of Java compared to C++ is the avoidance of multiple inheritance mechanism in Java. Multiple inheritance means one class may inherit from many ancestors and is the main cause of the impredictability of from where the class is inheriting in C++. In short Java has exactly the same power of C++ but without many unneccessary difficulties which makes the life difficult for programmers.

Java Is Platform Independent

C++programming language is a complied language. Compilation produces faster executing programs and is advantageous for speed, but first a relevant compiler must be present. Different operating systems, even different versions of the same operating system may require dedicated compilers. Compilers are difficult to develop and implement, many major programming languages may not be applied in some operating systems simply because the lack of compilers. There not advisable to distribute a raw source codes of the compiled programs in the Web pages since we can't know in which operating system this page will be downloaded and whether a suitable compiler exist for supporting this particular operating system. Java has resolved this dificulty in an ingenious way. Java programs are compiled againt a virtual machine, that means a machine with an operating system that is not actually existing. This is called Java Virtual Machine (JVM). JVM is an independent platform whose operating system not ressembling to any of the actual operational operating systems. Compilation of the Java programs againt the JVM result a program compiled to the bytecode that is the machine language of the platform independent JVM. Bytecode is universal in a sense that there is only one bytecode result of the particular Java source program. Bytecodes are not executable in any of the actual operating systems for that a translation of the sole bytecode file to the machine executable codes of the target operating system is necessary. This second stage of translation is more straight forward compared to the first compilation to the bytecode. Java designers decided to make this platform dependent translation with an interpreter, that is a code converter between Java bytecode and the target operating system. This result with an universal compilation to the JVM and interpreting the obtained bytecode file with a platform specific interpreter. This may be stated briefly as one compiler many interpreters or one program which may be run in many platforms.The Java motto: Write Once Run Anywhere (WORA), this is really a smart way of solving multiplatform problem. This also influenced Microsoft's visual studio system. From these, we can see that there is two translating stages of the Java source codes to the platform specific machine executable codes. First step is a compilation to universal Java bytecodes, second step is the interpreting all platforms applicable java bytecodes to the machine codes applicable to the target platfomr. First stage is a compilation process while second step is an interpreting process. The weakness of the translation lies just in that step, the interpretation is considerably slower process compared to the compilation process. This was the major drawback of Java in the beginning but today, faster compilation processes with JIT (Just In Time) compilers made Java programs running as fast as C++ programs and no more fierce complaints are stated about the execution speeds of the Java programs.

The platform independency of the Java programs is most welcome by the evolving World Wide Web. The published web pages may contain universally applicable bytecode portions which may be interpreted locally when downloaded to any operating system. Later it is discovered that script files are more suitable for the client side Internet system but Java impact is still the most preferred platform in server side programs and it seems that they will stay as such in the foreseable near future.

Java Is Secure

Java is designed as not infiltrating to the client machine filing system whatsoever when serving from the Internet. With Java, there will be lesser chance of having malicious codes hided in the programs with an innocent appearance. But it will be wise to not rely only the security of the Java programs and take appropriate measures to prevent all kinds of clandestine codes to invade the computer operating system.

Java Is Multitheaded

Multhreading is the ability of a program to excute different tasks in the same time period. Java is designed to support multhreading in program execution.

Java Is Object Oriented

Java is based in the objects. Objects are accumulations of data and the methods operating on that data in a single entity named class. Objects are the way of encapsulating related program elements in a single class. Objects can be considered as the new data types defined from the user. Objects can be arranged so that only their methods are accessilble from other classes thus exhibiting characteristics of type safety. Objects can inherent properties and methods from their ancestors. This feture is called inheritance. Inheritance is a very useful technique to prevent unnecessary definitions of the properties and methos in the object definitions. Java supports only single way inheritance that is inheriting from a single ancestor to ensure a well defined inheritance path of the objects.

<< Index

Polyglott HTML5(XHTML5 compliant HTML5 code)