Mukesh kumar C.S.E. 1110751908 5 th Semester INTRODUCTION TO JAVA Java language was developed by Sun Microsystem in the year 1991 as a part of green project. GREEN PROJECT: a research group was working to develop software to control consumer electronics devices, during this time they developed a device called " star 7" for which the operating system was planned to be developed in "c++" however one of the team member "James Gosling " was not very satisfy with the performance of c++ hence he developed a new language for start he named it as "oak" .he used to see an oak outside his office in 1995 Sun Microsystem renamed this language as java. FEATURES OF JAVA: 1) Object Oriented Programming 2) Platform Independent 3) Robust 4) Reliable, Safe & Secure 5) Compiler and Interpreter 6) Dynamic 7) Multithreaded 8) High perfomance 9) Portable 10) Simple & Easy to learn
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Mukesh kumar C.S.E. 1110751908 5th Semester
INTRODUCTION TO JAVA
Java language was developed by Sun Microsystem in the year 1991 as a part of green project.
GREEN PROJECT:
a research group was working to develop software to control consumer electronics devices, during
this time they developed a device called " star 7"
for which the operating system was planned to be developed in "c++"
however one of the team member "James Gosling " was not very satisfy with the performance of
c++ hence he developed a new language for start he named it as "oak"
.he used to see an oak outside his office
in 1995 Sun Microsystem renamed this language as java.
FEATURES OF JAVA:
1) Object Oriented Programming
2) Platform Independent
3) Robust
4) Reliable, Safe & Secure
5) Compiler and Interpreter
6) Dynamic
7) Multithreaded
8) High perfomance
9) Portable
10) Simple & Easy to learn
Mukesh kumar C.S.E. 1110751908 5th Semester
Object Oriented
o Object oriented throughout - no coding outside of class definitions, including main().
o An extensive class library available in the core language packages.
Platform Independence
o The Write-Once-Run-Anywhere ideal has not been achieved (tuning for different platforms usually required), but closer than with other languages.
Robust
o Exception handling built-in, strong type checking (that is, all data must be declared an explicit type), local variables must be initialized.
Security
o No memory pointers o Programs runs inside the virtual machine sandbox. o Array index limit checking
security manager - determines what resources a class can access such as reading and
writing to the local disk
Compiler/Interpreter
o Code is compiled to bytecodes that are interpreted by a Java virtual machines (JVM) .
o This provides portability to any machine for which a virtual machine has been written.
o The two steps of compilation and interpretation allow for extensive code checking and improved security.
Dynamic Binding
o The linking of data and methods to where they are located, is done at run-time. o New classes can be loaded while a program is running. Linking is done on the fly. o Even if libraries are recompiled, there is no need to recompile code that uses classes
in those libraries. This differs from C++, which uses static binding. This can result in fragile classes for cases where linked code is changed and memory pointers then point to the wrong addresses.
o Interpretation of bytecode slowed performance in early versions, but advanced virtual machines with adaptive and just-in-time compilation and other techniques now typically provide performance up to 50% to 100% the speed of C++ programs.
Threading
o Lightweight processes, called threads, can easily be spun off to perform multiprocessing.
o Can take advantage of multiprocessors where available o Great for multimedia displays.
What is the Java Virtual Machine?
The JVM is the software that executes Java bytecode. A Java program, written in a file with a
.java extension, is compiled into class files that have a .class extension. The class files are
written in bytecode. To execute these files, the computer uses the JVM to interpret the
bytecode.
A browser that is capable of executing Java applets has the JVM built into it. To run a Java
application, the Java Runtime Environment (JRE) must be installed. The JRE contains the
files in the Java Development Kit minus the development tools, only the files necessary to
run a Java application are present.
The bytecode is the same for all platforms, but the JVM will be different on different
platforms because it needs to execute programs using the native code of the machine it is
running on.
Development Tools: The development tools provide everything you'll need for compiling, running,
monitoring, debugging, and documenting your applications. As a new developer, the main tools
you'll be using are the javac compiler, the java launcher, and the javadoc documentation tool.
What is an Object
Object is instance of class, it contain data as well as behavior of the functions how to manipulate
that data.
What is a Class
Class is a collection of similar objects.
A class is a blueprint or prototype from which objects are created.