Java
Java
Java Example
Let's have a quick look at java programming example. A detailed description of
hello Java example is given in next page.
1. class Simple{
2. public static void main(String args[]){
3. System.out.println("Hello Java");
4. }
5. }
Where it is used
According to Sun, 3 billion devices run java. There are many devices where Java is
currently used. Some of them are as follows:
2) Web Application
An application that runs on the server side and creates dynamic page, is called web
application. Currently, servlet, jsp, struts, spring, hibernate, jsf etc. technologies
are used for creating web applications in java.
3) Enterprise Application
4) Mobile Application
An application that is created for mobile devices. Currently Android and Java ME are
used for creating mobile applications.
4) JavaFx
History of Java
1. Brief history of Java
2. Java Version History
The history of Java is very interesting. Java was originally designed for interactive
television, but it was too advanced technology for the digital cable television
industry at the time. The history of java starts from Green Team. Java team
members (also known as Green Team), initiated this project to develop a language
for digital devices such as set-top boxes, televisions etc. But, it was suited for
internet programming. Later, Java technology was incorporated by Netscape.
James Gosling
3) Firstly, it was called "Greentalk" by James Gosling and file extension was .gt.
4) After that, it was called Oak and was developed as a part of the Green project.
Why Java named as "Oak"
7) Why had they choosen java name for java language? The team gathered to
choose a new name. The suggested words were "dynamic", "revolutionary", "Silk",
"jolt", "DNA" etc. They wanted something that reflected the essence of the
technology: revolutionary, dynamic, lively, cool, unique, and easy to spell and fun
to say.
According to James Gosling "Java was one of the top choices along with Silk". Since
java was so unique, most of the team members preferred java.
8) Java is an island of Indonesia where first coffee was produced (called java
coffee).
11) In 1995, Time magazine called Java one of the Ten Best Products of 1995.
Features of Java
The main objective of Java programming language creation was to make it
portable, simple and secure programming language. Apart from this, there are also
some awesome features which play important role in the polularity of this language.
The features of Java are also known as java buzzwords. Following is a list of most
important features of Java language. The Java Features given below are simple and
easy to understand.
1. Simple
2. Object-Oriented
3. Portable
4. Platform independent
5. Secured
6. Robust
7. Architecture neutral
8. Dynamic
9. Interpreted
10. High Performance
11. Multithreaded
12. Distributed
Simple
Java is very easy to learn and its syntax is simple, clean and easy to understand.
According to Sun, Java language is simple because:
syntax is based on C++ (so easier for programmers to learn it after C++).
Object-oriented
Java is Object-oriented programming language. Everything in Java is an object.
Object-oriented means we organize our software as a combination of different
types of objects that incorporates both data and behaviour.
1.Object
2.Class
3.Inheritance
4.Polymorphism
5.Abstraction
6.Encapsulation
Platform Independent
The Java platform differs from most other platforms in the sense that it is a
software-based platform that runs on the top of other hardware-based platforms. It
has two components:
1. Runtime Environment
2. API(Application Programming Interface)
Java code can be run on multiple platforms e.g. Windows, Linux, Sun Solaris,
Mac/OS etc. Java code is compiled by the compiler and converted into bytecode.
This bytecode is a platform-independent code because it can be run on multiple
platforms i.e. Write Once and Run Anywhere(WORA).
Secured
Java is best known for its security. With Java, we can develop virus-free systems.
Java is secured because:
o No explicit pointer
o Java Programs run inside virtual machine sandbox
These security are provided by java language. Some security can also be provided
by application developer through SSL, JAAS, Cryptography etc.
Robust
Architecture-neutral
In C programming, int data type occupies 2 bytes of memory for 32-bit architecture
and 4 bytes of memory for 64-bit architecture. But in java, it occupies 4 bytes of
memory for both 32 and 64 bit architectures.
Portable
Java is portable because it facilitates you to carry the java bytecode to any
platform.
High-performance
Java is faster than traditional interpretation since bytecode is "close" to native code
still somewhat slower than a compiled language (e.g., C++). Java is an interpreted
language, so it is also a reason that why it is slower than compiled language C, C+
+.
Distributed
Java is distributed because it facilitates us to create distributed applications in java.
RMI and EJB are used for creating distributed applications. We may access files by
calling the methods from any machine on the internet.
Multi-threaded