What is Java?
- Java is an object-oriented programming language originally developed by Sun Microsystems and released in 1995.
- Java was originally developed by James Gosling at Sun Microsystems (which has since merge into Oracle Corporation).
- Java programs are platform independent which means they can be run on any operating system with any type of processor as long as the Java interpreter is available on that system.
- Java code that runs on one platform does not need to be recompiled to run on another platform, its called “write once, run anywhere” (WORA).
- JVM executes Java code, but is written in platform specific languages such as C/C++/ASM etc. JVM is not written in Java and hence cannot be platform independent and Java interpreter is actually a part of JVM.
Where is Java being Used?
Earlier, java was only used to design and program small computing devices but later adopted as one of the platform independent programming language and now according to Sun, 3 billion devices run java.
- JSP – Java is used to create web applications like PHP and ASP, JSP(Java Server Pages) used with norman HTML tags, which helps to create dynamic web pages.
- Applets – This is another type of Java program that used within a web page to add many new features to a web browser.
- J2EE – The software Java 2 Enterprise Edition are used by various companies to transfer data based on XML structured documents between one another.
- JavaBeans – This is something like Visual Basic, a reusable software component that can be easily assemble to create some new and advanced application.
- Mobile – Besides the above technology, Java is also used in mobile devices, many kind of games and services built in Java. Today, all leading mobile service provider like Nokia, Siemens, Vodafone are using Java technology.
Types of Java Applications
- Standalone ApplicationIt is also known as desktop application or window-based application. An application that we need to install on every machine or server such as media player, antivirus etc. AWT and Swing are used in java for creating standalone applications.
- Web Application Java is used to create web applications which runs on server side. Currently, servlet, jsp, struts, jsf etc. technologies are used for creating web applications in java.
- Enterprise Application An application that is distributed in nature, such as banking applications etc. It has the advantage of high level security, load balancing and clustering. In java, EJB is used for creating enterprise applications.
- Mobile Application An application that is created for mobile devices. Currently Android and Java ME are used for creating mobile applications.
Facts about Java
- Object Oriented – In java everything is an Object. Java can be easily expanded since it is based on the Object model.
- Platform independent – C and C++ are platform dependency languages hence the application programs written in one Operating system cannot run in any other Operating system, but in platform independence language like Java application programs written in one Operating system can able to run on any Operating system.
- Simple – Java is designed to be easy to learn. If you understand the basic concept of OOP java would be easy to master.
- Secure – With Java’s secure feature it enables to develop virus-free, tamper-free systems. Authentication techniques are based on public-key encryption.
- Architectural- neutral – Java compiler generates an architecture-neutral object file format which makes the compiled code to be executable on many processors, with the presence Java runtime system.
- Portable – being architectural neutral and having no implementation dependent aspects of the specification makes Java portable. Compiler and Java is written in ANSI C with a clean portability boundary which is a POSIX subset.
- Robust – Java makes an effort to eliminate error prone situations by emphasizing mainly on compile time error checking and runtime checking.
- Multi-threaded – With Java’s multi-threaded feature it is possible to write programs that can do many tasks simultaneously. This design feature allows developers to construct smoothly running interactive applications.
- Interpreted – Java byte code is translated on the fly to native machine instructions and is not stored anywhere. The development process is more rapid and analytical since the linking is an incremental and light weight process.
- High Performance – With the use of Just-In-Time compilers Java enables high performance.
- Distributed – Java is designed for the distributed environment of the internet.
- Dynamic – Java is considered to be more dynamic than C or C++ since it is designed to adapt to an evolving environment. Java programs can carry extensive amount of run-time information that can be used to verify and resolve accesses to objects on run-time.
Different Editions of Java Technology
- Java SE – Java SE or Java Standard Edition provides tools and API’s that you can use to create server applications, desktop applications, and even applets. These programs developed using Java SE can be run on almost every popular operating system, including Linux, Macintosh, Solaris, and Windows.
- JEE – Based on the foundation framework of the standard edition, Java Enterprise Edition helps in web application service, component model and enterprise class service oriented architecture (SOA).
- JME – Java Micro Edition or JME for short is an accumulation of Java APIs that are used for the development of software for devices like mobile phones, PDAs, TV set-top boxes, game programming. The platform of micro edition generally consists of an easy user interface, a robust security model and a wide variety of built-in networks for running Java based application.
What you will need
- You will need the Java software development kit from http://java.sun.com/
- Follow the instructions on Sun’s website to install it.
- Make sure that you add the java bin directory to your PATH environment variable.
Popular Java Editors
To write your java programs you will need a text editor. There are even more sophisticated IDE available in the market. But for now, you can consider one of the following:
- Notepad – On Windows machine you can use any simple text editor like Notepad (Recommended for this tutorial), TextPad.
- Netbeans – is a Java IDE that is open source and free which can be downloaded from http://www.netbeans.org/index.html
- Eclipse – is also a java IDE developed by the eclipse open source community and can be downloaded from http://www.eclipse.org/