Java Programming
java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
There were five primary goals in the creation of the Java language:
¨ It should use the object-oriented programming methodology.
¨ It should allow the same program to be executed on multiple operating systems.
¨ It should contain built-in support for using computer networks.
¨ It should be designed to execute code from remote sources securely.
¨ It should be easy to use by selecting what was considered the good parts of other object-oriented languages
History of Java
First version of
released in 1995 by James Gosling at Sun Microsystems.Initially it was named
Oak. In 1995, Oak was renamed as "Java" because it was
already a trademark by Oak Technologies.
JDK Editions
With the advancement of Java and its widespread popularity, multiple
configurations were built to suit various types of platforms.
·
Java
Standard Edition (SE): used to develop client-side standalone applications or applets.
· Java Enterprise Edition (J2EE) : used to develop server-side applications such as Java servlets and Java ServerPages.
· Java Micro Edition (J2ME): used to develop applications for mobile devices such as cell phones.
Java Version History
¨ JDK
Alpha and Beta (1995)
¨ JDK
1.0 (23rd Jan 1996)
¨ JDK
1.1 (19th Feb 1997)
¨ J2SE
1.2 (8th Dec 1998)
¨ J2SE
1.3 (8th May 2000)
¨ J2SE
1.4 (6th Feb 2002)
¨ J2SE
5.0 (30th Sep 2004)
¨ Java
SE 6 (11th Dec 2006)
¨ Java
SE 7 (28th July 2011)
¨ Java
SE 8 (18th March 2014)
¨ Java
SE 9 (21st Sep 2017)
¨ Java
SE 10 (20th March 2018)
Popular Java Editors
¨ Notepad −
On Windows machine, you can use any simple text editor like Notepad
¨ Netbeans −
A Java IDE that is open-source and free which can be downloaded
¨ Eclipse −
A Java IDE developed by the eclipse open-source community
Features of
Java
¨ Simple
¨ Object-Oriented
¨ Portable
¨ Platform
independent
¨ Secured
¨ Robust
¨ Architecture
neutral
¨ Interpreted
¨ High
Performance
¨ Multithreaded
¨ Distributed
¨ Dynamic
Simple
Java is very easy to learn, and
its syntax is simple, clean and easy to understand. Its syntax is based on
C++.Java has removed many complicated and rarely-used features, for example,
explicit pointers, operator overloading, etc. In java there is no need to
remove unreferenced objects because there is an Automatic Garbage Collection in
Java.
Object-oriented
¨ Object
¨ Class
¨ Inheritance
¨ Polymorphism
¨ Abstraction
¨ Encapsulation
Platform Independent
A platform is
the hardware or software environment in which a program runs.java provides a software-based platform, that runs
on the top of other hardware-based platforms It has two components: Runtime
Environment API(Application Programming Interface) Java code can be run on
multiple platforms for eg, Windows, Linux, Sun Solaris, Mac/OS, etc. Java code
is compiled by the compiler and converted into bytecode.This byte code 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: it has No explicit pointer. Java
Programs run inside a virtual machine sandbox
Classloader:
Classloader in Java
is a part of the Java Runtime Environment(JRE) which is used to load Java
classes into the Java Virtual Machine dynamically. It adds security by
separating the package for the classes of the local file system from those that
are imported from network sources.
Bytecode Verifier:
It checks the code fragments for illegal code that can violate
access right to objects.
Security Manager:
It determines what resources a class can access such as reading and writing to the local disk.
Robust: Robust
simply means strong.
¨ Java
uses strong memory management.
¨ There
is a lack of pointers that avoids security problems.
¨ There
is automatic garbage collection in java which runs on the Java Virtual Machine
to get rid of objects which are not being used by a Java application anymore.
¨ There
are exception handling and the type checking mechanism in Java.
Architecture-neutral
¨ Java
is architecture neutral because there are no implementation dependent features
¨ In
C programming, int data type occupies 2 bytes of memory for 32-bit architecture
and 4 bytes of memory for 64-bit architecture.
¨ However, it occupies 4 bytes of memory for
both 32 and 64-bit architectures in Java.
Portable
Java is portable because it facilitates you to carry the
Java bytecode to any platform. It doesn't require any implementation.
High-performance
Java
is faster than other traditional interpreted programming languages because Java
bytecode is "close" to native code. It is still a little bit slower
than a compiled language (e.g., C++). Java is an interpreted language
that is why it is slower than compiled languages, e.g., C, C++, etc. With the use of Just-In-Time
compilers, Java enables high performance.
Dynamic
Java
is a dynamic language. It supports dynamic loading of classes. It means classes
are loaded on demand. It also supports functions from its native languages,
i.e., C and C++. Java supports
dynamic compilation and automatic memory management (garbage collection).
Distributed
Java
is distributed because it facilitates users to create distributed applications
in Java. RMI and EJB are used for creating distributed applications. This
feature of Java makes us able to access files by calling the methods from any
machine on the internet.
Multi-threaded
With
Java's multithreaded feature it is possible to write programs that can perform
many tasks simultaneously. This design feature allows the developers to
construct interactive applications that can run smoothly.
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.
No comments:
Post a Comment