Java is an object-oriented programming language with its runtime environment. It is a combination of features of C and C++ with some essential additional concepts. Java is well suited for both standalone and web application development and is designed to provide solutions to most of the problems faced by users of the internet era.
What is Java?
- Java is an object-oriented programming language developed by Sun Microsystems, and it was released in 1995.
- James Gosling initially developed Java in Sun Microsystems (which was later merged with Oracle Corporation).
- Java is a set of features of C and C++. It has obtained its format from C, and OOP features from C++.
- Java programs are platform independent which means they can be run on any operating system with any 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; it's called write once, run anywhere(WORA).
- Java Virtual Machine (JVM) executes Java code, but it has been 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 a part of JVM.
Where is Java being Used?
Earlier Java was only used to design and program small computing devices, but it was later adopted as one of the platform-independent programming languages, and now according to Sun, 3 billion devices run Java.
Java is one of the most important programming languages in today's IT industries.
- JSP - In Java, JSP (Java Server Pages) is used to create dynamic web pages, such as in PHP and ASP.
- Applets - Applets are another type of Java programs that are implemented on Internet browsers and are always run as part of a web document.
- J2EE - Java 2 Enterprise Edition is a platform-independent environment that is a set of different protocols and APIs and is used by various organizations to transfer data between each other.
- JavaBeans - This is a set of reusable software components that can be easily used to create new and advanced applications.
- Mobile - In addition to the above technology, Java is widely used in mobile devices nowadays, many types of games and applications are being made in Java.
Types of Java Applications
- Web Application - Java is used to create server-side web applications. Currently, Servlet, JSP, Struts, JSF, etc. technologies are used.
- Standalone Application - It is also known as the 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.
- 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 - Java is used to create application software for mobile devices. Currently, Java ME is used for building applications for small devices, and also Java is a programming language for Google Android application development.
Features of Java
- Object-Oriented - Java supports the features of object-oriented programming. Its object model is simple and easy to expand.
- 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 has included many features of C / C ++, which makes it easy to understand.
- Secure - Java provides a wide range of protection from viruses and malicious programs. It ensures that there will be no damage and no security will be broken.
- Portable - Java provides us with the concept of portability. Running the same program with Java on different platforms is possible.
- Robust - During the development of the program, it helps us to find possible mistakes as soon as possible.
- Multi-threaded - The multithreading programming feature in Java allows you to write a program that performs several different tasks simultaneously.
- Distributed - Java is designed for distributed Internet environments as it manages the TCP/IP protocol.
Popular Java Editors
You will need a text editor to write Java programs. There is 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/