Introduction to Java Technology
Java is an object-oriented programming language. Java language is originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language is derived much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture that's why Java is called platform independent.
James Gosling started the Java language project in June 1991 for use in one of his many set-top box projects. The language, initially called Oak after an oak tree that stood outside Gosling's office, also went by the name Green and ended up later renamed as Java, from a list of random words. Gosling aimed to implement a virtual machine and a language that had a familiar C/C++ style of notation.
There were following 5 primary goals in the creation of Java language:
- Should be simple, object-oriented, and familiar.
- Should be robust and secure.
- Should be architecture natural and portable.
- Should execute with high performance.
- Should be interpreted, threaded, and dynamic.
Programs written in Java have had a reputation for being slower and requiring more memory than those written in some other languages. However, Java programs' execution speed improved significantly with the introduction of Just-in-time compilation in 1997/1998 for Java 1.1.
Platform Independence
The concept behind java is “write once run anywhere”. Java is platform independent because Java is portable, which means that computer programs written in the Java language must run similarly on any supported hardware/operating-system platform. This is achieved by compiling the Java language code to an intermediate representation called Java bytecode, instead of directly to platform-specific machine code. Java bytecode instructions are analogous to machine code, but are intended to be interpreted by a Java Virtual Machine (JVM) written specifically for the host hardware. End-users commonly use a Java Runtime Environment (JRE) installed on their own machine for standalone Java applications, or in a Web browser for Java applets.
Platform independence means your same application can run on multiple platforms like UNIX, Linux, and Windows etc. You have no need to develop different versions of your application for each platform.
Features
The Java programming language has following features:
- Platform Independent: The concept of Write-once-run-anywhere (known as the Platform independent) is one of the important key feature of java language that makes java as the most powerful language.
- Simple: Java is a simple language. Java programs are easy to write and debug because java does not use the pointers explicitly. It is much harder to write the java programs that can crash the system which can be possible in some other languages. Java offers the bug free system due to the strong memory management. It' also has the automatic memory allocation and deallocation system.
- Object-oriented: Java is 100% object-oriented language. Java provides powerful object-oriented concepts implementation like Inheritance, Polymorphism, Abstraction, Encapsulation, Association, Composition and Aggregation etc.
- Robust: Java has the powerful memory allocation and automatic garbage collection mechanism. It provides the strong exception handling and type checking mechanism as compare to other programming languages. Compiler validates/checks the program whether there any error and interpreter checks any run time error and makes the system secure from crash. All of the above features make the java language robust.
- Distributed: The widely used protocols like HTTP and FTP are developed in java. Internet programmers can call functions on these protocols and can get access the files from any remote machine on the internet rather than writing codes on their local system.
- Portable: Java Virtual Machine (JVM) implementations for different platforms make Java applications portable across different platforms.
- Dynamic: Java has dynamic nature. While executing the java program the user can access or get the required files dynamically from a local drive or from a computer thousands of miles away from the user just by connecting with the Internet.
- Secure: Java is very secure language. Java does not use memory pointers explicitly like C++. All the programs in java are run under an area known as the sand box. Java language applies multiple checks on application code. Java Security manager checks the accessibility options of a class like reading and writing a file to the local disk. Java uses the public key encryption system to allow the java applications to transmit over the internet in the secure encrypted form. The bytecode Verifier checks the classes after loading.
- Performance: Java uses native code usage, and lightweight process called threads. Java is not slow anymore. In the beginning interpretation of bytecode resulted the performance slow but the advance version of JVM uses the adaptive and just in time compilation technique that improves the performance.
- Multithreaded: Java is multithreaded language so it is ideal for multithreaded applications. Multithreading means a single program having different threads executing independently at the same time. Multiple threads execute instructions according to the program code in a process or a program. Multithreading works the similar way as multiple processes run on one computer.
- Interpreted: We all know that Java is an interpreted language as well. With an interpreted language such as Java, programs run directly from the source code. The interpreter programs read the source code, compiles (translates) the source code into machine code and then execute the machine code. So Java checks application errors twice, at compile time and on run time.
Applications
Java is widely used to develop internet, intranet, enterprise level, embeded, mobile and desktop applications.
Java Development Kit
JDK is the acronym for Java Development Kit- essentially a Java platform. A free software development package from Sun Microsystems that implements the basic set of tools needed to write, test and debug Java applications and applets.
JDK is consisting of the API classes, a Java compiler, and the Java Virtual Machine interpreter. The JDK is used to compile Java applications and applets. The most current version is the J2SE.
