1.JavaBasic
1.JavaBasic
BASIC
HISTORY :
JAVA was developed by Sun Microsystems Inc in 1991, later acquired by Oracle Corporation. It was
developed by James Gosling and Patrick Naughton.
What is Java?
Java is an object-oriented, class-based, concurrent, secured, platform Independent and general-purpose
computer-programming language.
1. Abstraction
2. Encapsulation
3. Inheritance
4. Polymorphism
Secure:We don’t have pointers and we cannot access out of bound arrays (you get
ArrayIndexOutOfBoundsException if you try to do so) in java. That’s why several security flaws like stack
corruption or buffer overflow is impossible to exploit in Java.
Concurrent: In simple words, concurrency is the ability to run several programs or several parts of a
program in parallel.
Platform Independent: Which means a program that is compiled on windows can run on Linux or on any
other operating system and vice-versa.
What is JDK?
PerfectLearn-Pune-9168313434
JDK: Contains JRE and JVM.JDK compile program using compiler (javac) and execute program (only
convert .java file into .class file).This .class file contains bytecode.
JDK=JRE + Development tool
JRE: Contains JVM and predefined classes and runtime Libraries we are using this in class to design
program.
JRE= JVM+ Classes and Libraries
JVM : It’s a virtual machine it doesn’t exist. It examines bytecode and execute it. For that jvm uses libraries
present in JRE.
Each operating system has different JVM.
[In Short: JDK contains JRE and JRE contains JVM, means JRE and JVM comes inside JDK]
How Java works?
We write the program, then we compile the program and at last we run the program.
1) Writing of the program is of course done by java programmer like you and me.
2) Compilation of program is done by javac compiler, javac is the primary java compiler included in java
development kit (JDK). It takes java program (.java file) as input and generates java bytecode (.class file)
as output.bytecode is not human redable.
3) In third phase, JVM executes the bytecode generated by compiler. This is called program run phase.
Application?
According to Sun, 3 billion devices run Java. There are many devices where Java is currently used. Some of
them are as follows:
PerfectLearn-Pune-9168313434
6. Smart Card
7. Robotics
8. Games, etc.
PerfectLearn-Pune-9168313434