Introduction to Java
Java is a general-purpose object oriented computer-programming language that is class based and concurrent, specifically designed to have as few implementation dependencies as possible.
This lets programmers and application developers write once, run anywhere meaning that compiled Java code can run on all platforms that support Java without the need for recompilation.
Java applications are compiled to byte code’s that can run on any Java virtual machine (JVM) regardless of its computer architecture.
Java was originally developed by James Gosling and Patrick Naughton at Sun Microsystems (which was later acquired by Oracle Corporation). Java derives much of its syntax from C and C++ and also has many other important features.
The development of Java originally was started by a team of 30 people led by James gosling and Patrick Naughton. They named this project as Green which was later changed to Java in course of time.
The main aim behind the implementation of Java is to build a programming laungage which can be used in electronic items, and also which has less execution time, less memory and power consumption.
They wanted the language to be Simple and robust, Architecture neutral.
Simple includes less execution time ( Ex: let’s consider we are switching through channels in our television if that takes more amount to time to switch from one channel to another then we might not like watching the TV, so here in this scenario the execution time has to be less).
Architecture neutral includes the program written once has to get executed in every Java supported device. We can refer it to as WORA ( Write Once Run Anywhere).
Major release versions of Java, along with their release dates:
Comparision of Java with other Programming Languages(C and C++)
C and C++ are static where Java is dynamic
C and C++ are static PL : Static PL refers to the PL which allocates memory for primitive data types at compilation time. Most of you might get confused here referring that there are calloc() and malloc() functions for memory allocations.
Those are for explicit memory allocation (developer use), in context to default memory allocation the memory is allocated at compilation time.
Java is a dynamic PL : Dynamic PL refers to PL which allocates memory for primitive data types at run time.
Include statements are used define the header files in C Import is used to define packages in Java
#include statements are recognised by pre-processor and the specific header files are replaced by the code written in them Import statements are recognised by compiler and JVM
#include supports static memory loading Import supports dynamic memory loading
We can include only one header file using one include statement
We can include multiple packages using one import statement
import java.io.*; import java.util.*;
Let’s consider that we want to implement stack operations using C language, basically stack has three operations PUSH, POP and PEEK. PUSH is used to insert the data into the stack, POP is used to delete the data from the stack and PEEK is used to read the data present in the stack.
To complete this we require some 30-40 lines of code in C language. Let’s see how many lines of code we require to perform same operation using java.
Stack s = new stack(); s.push(AAA); s.pop(); s.peek();
Types of Applications that Run on Java
Simple: Java is designed to be easy, simple and robust programming language which uses less memory and gives high performance.
Object-Oriented: Uses objects for memory allocation at run time.
Platform-Independent: We can move the Java programs from one system to another with ease.
Secure: The Java language, compiler, interpreter, and runtime environment were each developed with security in mind.
Allocation: This uses stack memory allocation where we can store and retrieve data in a much easier manner.
Multithreaded:we can perform simultaneous tasks with in a program with ease.
1. Desktop GUI Applications:
Java provides GUI development through various means like Abstract Windowing Toolkit (AWT), Swing and JavaFX.
While AWT contains a number of pre-constructed components such as menu, button, list, and numerous third-party components, Swing, a GUI widget toolkit, additionally provides certain advanced components like trees, tables, scroll panes, tabbed panel and lists.
2. Mobile Applications:
Java Platform, Micro Edition (Java ME or J2ME) is a cross-platform framework used to design applications that run across all Java supported devices, including feature phones and smart phones.
Further, the applications for Android, one of the most popular mobile operating systems, are usually scripted in Java using the Android Software Development Kit (SDK) or other development environments.
3. Embedded Systems:
Embedded systems, ranging from tiny chips to specialized computers, are components of larger electromechanical systems performing dedicated tasks.
Several devices, such as SIM cards, blue-ray disk players, utility meters and televisions, use embedded Java technologies. According to Oracle, 100% of Blu-ray Disc Players and 125 million TV devices employ Java.
4. Web Applications:
Java provides support for web applications through Servlets, Struts or JSPs. The easy programming and higher security offered by the programming language has allowed a large number of government applications for health, social security, education and insurance to be based on Java.
Java also finds application in development of eCommerce web applications using open-source eCommerce platforms, such as Broadleaf.
5. Web Servers and Application Servers:
The Java ecosystem today contains multiple Java web servers and application servers.
While Apache Tomcat, Simple, Jo!, Rimfaxe Web Server (RWS) and Project Jigsaw dominate the web server space, WebLogic, WebSphere, and Jboss EAP dominate commercial application server space.
6. Enterprise Applications:
Java Enterprise Edition (Java EE) is a popular platform that provides API and runtime environment for scripting and running enterprise software, including network applications and web-services. Oracle claims Java is running in 97% of enterprise computers.
The higher performance guarantee and faster computing in Java has resulted in high frequency trading systems like Murex to be scripted in the language. It is also the backbone for a variety of banking applications which have Java running from front user end to back server end.
7. Scientific Applications:
Java is the choice of many software developers for writing applications involving scientific calculations and mathematical operations. These programs are generally considered to be fast and secure, have a higher degree of portability and low maintenance.
Applications like MATLAB use Java both for interacting user interface and as part of the core system.
Types of Applications that Run on Java
This is Krishna.I am the author of this blog. I am a technology enthusiast. If you found this article helpful please share it with your friends. Please provide your valuable comments on this blog.