SlideShare a Scribd company logo
1 of 23
History of Java
Java is a general purpose object oriented
programming language.
Developed by James Gosling, Patrick
Naughton, Chris Warth, Ed Frank, and Mike
Sheridan at Sun Microsystems, Inc. in 1991.
Initially called “Oak” but was renamed as “Java” in
1995 after the coffee used to named „Java coffee‟.
Initial motivation is to develop a platform
independent language to create software to be
embedded in various consumer electronics
devices, evenly over mobile devices.
Become the language of internet. (portability and
security).
Features of Java
1. Simple, Small and Familiar
2. Compiled and Interpreted
3. Object Oriented
4. Platform Independent and portable
5. Robust and Secure
6. Distributed / Network Oriented
7. Multithreaded and Interactive
8. High Performance
9. Dynamic
Simple, Small and Familiar
Similar to C/C++ in syntax
But eliminates several complexities like -
No operator overloading
No direct pointer manipulation or pointer
arithmetic
No multiple inheritance (exclusion of Dimond
problem).
No malloc() and free(). It handles memory
automatically with the help of garbage collector.
Compiled and Interpreted
Java works in two stage
Java compiler translate the source code into byte
code. (javac.exe)
Java interpreter converts the byte code into
machine level representation. (Java /Just-In-Time)
Byte Code:
-A highly optimized set of instructions to be
executed by the java runtime environment, known
as java virtual machine (JVM).
Java Virtual Machine (JVM):
- Need to be implemented for each platform.
- Although the details vary from machine to
machine, all JVM understand the same byte code.
Java Virtual Machine
Java compiler produces an intermediate
code known as byte code for a
machine, known as JVM.
It exists only inside the computer memory.
Machine code is generated by the java
interpreter by acting as an intermediary
between the virtual machine and real
machine.
Java Program
Java Compiler
(JavaC)
Java Virtual Machine
(Java)
Bytecode
Java Interpreter /
Just In Time
Machine Code
/ 01010101
Start
End
.java
.class
Object Oriented
Fundamentally based on OOP
Classes and Objects
Efficient re-use of packages such
that the programmer only cares
about the interface and not the
implementation.
The object model in java is simple
and easy to extend.
Platform Independent and
Portable
“Write-Once Run-Anywhere”
Changes in system resources will not
force any change in the program.
The Java Virtual Machine (JVM) hides
the complexity of working on a
particular platform
Convert byte code into machine level
representation automatically.
Robust and Secure
Designed with the intention of being secure
No pointer arithmetic or manual memory
management.
Strict compile time and run time checking
of data type.
Exception handling
It verify all memory access
Ensure that no viruses are communicated
with an applet.
Distributed and Network Oriented
 Java grew up in the days of the Internet After
FreeBSD came in the picture.
 Berkeley Software Distribution (pioneers
of internet).
Inherently network friendly
Original release of Java came with
Networking libraries
Newer releases contain even more for
handling distributed applications.
RMI (remote method
Multithreaded and Interactive
Handles multiple tasks simultaneously.
Java runtime system contains tools to
support multiprocess synchronization and
construct smoothly running interactive
systems.
Java supports Threading to modulate the
task and is capable of handling it.
High Performance
Java performance is slower than C, because it
handles more complicated task than C language.
Incorporation of multithreading enhance the
overall execution speed.
Just-in-Time (JIT) can compile the byte code into
machine code.
Can sometimes be even faster than compiled C
code.
As it dose not include the library files as like C
into the byteCode file, its linking & working is
faster.
Dynamic
Capable of dynamically linking a new class
libraries, methods and objects, with the OOPS
pillar ‘Modularity’.
Java can use efficient functions available in
C/C++. Means it can connect the source code of
C,C++ with its source code.
Installing new version of library
files, automatically updates all programs as the
library is linked and not included.
The C# Connection
 The reach and power of Java continues to be felt in the
world of computer language development.
 Many of its innovative features, constructs, and
concepts have become part of the baseline for any
new language. The success of Java is simply too
important to ignore.
 Perhaps the most important example of Java‟s
influence is C#. Created by Microsoft to support the
.NET Framework, C# is closely related to Java. For
example, both share the same general syntax, support
distributed programming, and utilize the same object
model.
 There are, of course, differences between Java and
C#, but the overall “look and feel” of these languages
is very similar. This “cross-pollination” from Java to C#
is the strongest testimonial to date that Java redefined
the way we think about and use a computer language.
Language of Internet
Programming
1. Applets:
 Special java program that can transmitted over the
network and automatically executed by a java-compatible
web browser or Applet runner.
2. Security:
 Java compatible web browser can download java
applets without fear of viral infection and malicious
agent.
 As the Applet dose not request for the main() function
to run it, so it cannot hamper the computer system. No
Admin rights provided to Applet.
3. Portable:
 Java applets can be dynamically downloaded to all the
various types of platforms connected to the internet.
Why portable and Secure?
The output of java compiler is not executable code.
Once JVM exists for a platform, any java program can
run on it.
The execution of byte code by the JVM makes java
programs portable.
Actually for different platform separate JVM is made.
Java program is limited within the java execution
environment (JVM) and cannot access the other part of
the computer. That why it is secure.
Basics of Java Environments
Java programs normally undergo five phases
Edit
Programmer writes program / source code (and stores program on disk in
.java file).
Compile
Compiler creates bytecodes from source code (.class file)
Load
Class loader stores bytecodes in memory (it is part of JVM). There are 3
loaders in JVM –
Bootstrap class loader
Extensions class loader
System class loader
Verify
Verifier ensures bytecodes do not violate security requirements
Execute
Interpreter translates bytecodes into machine language
.
.
.
.
.
.
Primary
Memory
Disk
Disk
Disk
Editor
Compiler
Class Loader
Program is
created in an
editor and stored
on disk in a file
ending with
.java.
Compiler creates
bytecodes and
stores them on
disk in a file
ending with
.class.
Class loader
reads .class
files containing
bytecodes from
disk and puts
those bytecodes
in memory.
Phase 1
Phase 2
Phase 3
Primary
Memory
.
.
.
.
.
.
Bytecode Verifier
Bytecode verifier
confirms that all
bytecodes are
valid and do not
violate Java‟s
security
restrictions.
Phase 4
.
.
.
.
.
.
Interpreter
Interpreter reads
bytecodes and
translates them
into a language
that the computer
can understand,
possibly storing
data values as the
program
executes.
Phase 5
Primary
Memory
Languages that JVM understand
These languages are made with the help of Java but some of them
are independent of JVM and some are not.
Java Environment
Development tools - part of java development kit (JDK).
Runtime Environment – Java Runtime Environment.
(JRE).
Classes and methods - part of Java Standard Library
(JSL), also known as Application Programming Interface
(API).
Inclusions in JDK:
Appletviewer ( for viewing applets)
Javac (Compiler)
Java (Interpreter)
Javap (Java disassembler)
Javah (for C header files)
Javadoc ( for creating HTML description)
Jdb (Java Debugger)
Java Environment (Cntd.)
2. Application Package Interface (API)
Contains hundreds of classes and methods grouped
into several functional packages:
Language Support Package
Utility Packages
Input / Output Packages
Networking Packages
AWT Package
Applet Package
The Evolution of Java
1. Java 1.0 (January 23, 1996)
2. Java 1.1 (February 19, 1997) (Add new library, redefine applet
handling and reconfigured many features.)
3. Java 2 (Second generation) (December 8, 1998) . Version
no:1.2 (Internal version number of java library). Also known as
J2SE [ Java 2 Platform Standard Edition].
- Add swing, the collection framework, enhanced JVM etc.
4. J2SE 1.3 (May 8, 2000)
5. J2SE 1.4 (February 6, 2002)
6. Java 5 (fifth generation). Version no: 1.5 (Internal version
number of java library) (September 30, 2004)
7. Java 6 (sixth generation). Version no: 1.6 (Internal version
number of java library) (December 11, 2006).
8. Java 7 (sixth generation). Version no: 1.7 (Internal version
number of java library) (July 28, 2011)
Versions of Java
Three versions of the Java 2 Platform, targeted at different uses
Java 2 Micro Edition (J2ME)
Very small Java environment for smart
cards, pages, phones, and set-top boxes
Subset of the standard Java libraries aimed at limited size and
processing power
Java 2 Standard Edition (J2SE)
The basic platform
J2SE can be used to develop client-side standalone
applications or applets.
Java 2 Enterprise Edition (J2EE)
For business applications, web services, mission-critical
systems
Transaction processing, databases, distribution, replication

More Related Content

What's hot

Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Mr. Akaash
 
Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)Sahil Gupta
 
J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01Jay Palit
 
Features of java unit 1
Features of java unit 1Features of java unit 1
Features of java unit 1RubaNagarajan
 
Java Programming (M&M)
Java Programming (M&M)Java Programming (M&M)
Java Programming (M&M)mafffffe19
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruitersph7 -
 
1 Introduction To Java Technology
1 Introduction To Java Technology 1 Introduction To Java Technology
1 Introduction To Java Technology dM Technologies
 
Intoduction to java
Intoduction to javaIntoduction to java
Intoduction to javajalinder123
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Sandeep Rawat
 
J2EE Struts with Hibernate Framework
J2EE Struts with Hibernate FrameworkJ2EE Struts with Hibernate Framework
J2EE Struts with Hibernate Frameworkmparth
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)Sujit Majety
 
Introduction to Java Programming
Introduction to Java Programming Introduction to Java Programming
Introduction to Java Programming Saravanakumar R
 
A Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineA Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineAbdelrahman Hosny
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programmingElizabeth Thomas
 

What's hot (20)

Java unit 1
Java unit 1Java unit 1
Java unit 1
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...
 
Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)
 
J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01
 
An introduction to java programming language forbeginners(java programming tu...
An introduction to java programming language forbeginners(java programming tu...An introduction to java programming language forbeginners(java programming tu...
An introduction to java programming language forbeginners(java programming tu...
 
Features of java unit 1
Features of java unit 1Features of java unit 1
Features of java unit 1
 
Learn Java Part 1
Learn Java Part 1Learn Java Part 1
Learn Java Part 1
 
Java Programming (M&M)
Java Programming (M&M)Java Programming (M&M)
Java Programming (M&M)
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruiters
 
1 Introduction To Java Technology
1 Introduction To Java Technology 1 Introduction To Java Technology
1 Introduction To Java Technology
 
Intoduction to java
Intoduction to javaIntoduction to java
Intoduction to java
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
J2EE Struts with Hibernate Framework
J2EE Struts with Hibernate FrameworkJ2EE Struts with Hibernate Framework
J2EE Struts with Hibernate Framework
 
Introducing Java 7
Introducing Java 7Introducing Java 7
Introducing Java 7
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
 
JAVA First Day
JAVA First DayJAVA First Day
JAVA First Day
 
Introduction to Java Programming
Introduction to Java Programming Introduction to Java Programming
Introduction to Java Programming
 
A Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineA Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual Machine
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programming
 
Java lab lecture 1
Java  lab  lecture 1Java  lab  lecture 1
Java lab lecture 1
 

Similar to Java Lecture 1

Similar to Java Lecture 1 (20)

java introduction.docx
java introduction.docxjava introduction.docx
java introduction.docx
 
JAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptxJAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptx
 
Java
JavaJava
Java
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java Slides
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
 
Java chapter 1
Java   chapter 1Java   chapter 1
Java chapter 1
 
0f0cef_1dac552af56c4338ab0672859199e693.pdf
0f0cef_1dac552af56c4338ab0672859199e693.pdf0f0cef_1dac552af56c4338ab0672859199e693.pdf
0f0cef_1dac552af56c4338ab0672859199e693.pdf
 
Java-Unit-I.ppt
Java-Unit-I.pptJava-Unit-I.ppt
Java-Unit-I.ppt
 
Unit1 JAVA.pptx
Unit1 JAVA.pptxUnit1 JAVA.pptx
Unit1 JAVA.pptx
 
Java1
Java1Java1
Java1
 
Java
Java Java
Java
 
Java presentation
Java presentationJava presentation
Java presentation
 
Core java slides
Core java slidesCore java slides
Core java slides
 
Dr. Rajeshree Khande :Intoduction to java
Dr. Rajeshree Khande :Intoduction to javaDr. Rajeshree Khande :Intoduction to java
Dr. Rajeshree Khande :Intoduction to java
 
Java Introduction | PDF
Java Introduction |  PDFJava Introduction |  PDF
Java Introduction | PDF
 
Notes of java first unit
Notes of java first unitNotes of java first unit
Notes of java first unit
 
JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptx
 
Java Intro
Java IntroJava Intro
Java Intro
 
OOPS JAVA.pdf
OOPS JAVA.pdfOOPS JAVA.pdf
OOPS JAVA.pdf
 
Java session2
Java session2Java session2
Java session2
 

Recently uploaded

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Recently uploaded (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Java Lecture 1

  • 1. History of Java Java is a general purpose object oriented programming language. Developed by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun Microsystems, Inc. in 1991. Initially called “Oak” but was renamed as “Java” in 1995 after the coffee used to named „Java coffee‟. Initial motivation is to develop a platform independent language to create software to be embedded in various consumer electronics devices, evenly over mobile devices. Become the language of internet. (portability and security).
  • 2. Features of Java 1. Simple, Small and Familiar 2. Compiled and Interpreted 3. Object Oriented 4. Platform Independent and portable 5. Robust and Secure 6. Distributed / Network Oriented 7. Multithreaded and Interactive 8. High Performance 9. Dynamic
  • 3. Simple, Small and Familiar Similar to C/C++ in syntax But eliminates several complexities like - No operator overloading No direct pointer manipulation or pointer arithmetic No multiple inheritance (exclusion of Dimond problem). No malloc() and free(). It handles memory automatically with the help of garbage collector.
  • 4. Compiled and Interpreted Java works in two stage Java compiler translate the source code into byte code. (javac.exe) Java interpreter converts the byte code into machine level representation. (Java /Just-In-Time) Byte Code: -A highly optimized set of instructions to be executed by the java runtime environment, known as java virtual machine (JVM). Java Virtual Machine (JVM): - Need to be implemented for each platform. - Although the details vary from machine to machine, all JVM understand the same byte code.
  • 5. Java Virtual Machine Java compiler produces an intermediate code known as byte code for a machine, known as JVM. It exists only inside the computer memory. Machine code is generated by the java interpreter by acting as an intermediary between the virtual machine and real machine. Java Program Java Compiler (JavaC) Java Virtual Machine (Java) Bytecode Java Interpreter / Just In Time Machine Code / 01010101 Start End .java .class
  • 6. Object Oriented Fundamentally based on OOP Classes and Objects Efficient re-use of packages such that the programmer only cares about the interface and not the implementation. The object model in java is simple and easy to extend.
  • 7. Platform Independent and Portable “Write-Once Run-Anywhere” Changes in system resources will not force any change in the program. The Java Virtual Machine (JVM) hides the complexity of working on a particular platform Convert byte code into machine level representation automatically.
  • 8. Robust and Secure Designed with the intention of being secure No pointer arithmetic or manual memory management. Strict compile time and run time checking of data type. Exception handling It verify all memory access Ensure that no viruses are communicated with an applet.
  • 9. Distributed and Network Oriented  Java grew up in the days of the Internet After FreeBSD came in the picture.  Berkeley Software Distribution (pioneers of internet). Inherently network friendly Original release of Java came with Networking libraries Newer releases contain even more for handling distributed applications. RMI (remote method
  • 10. Multithreaded and Interactive Handles multiple tasks simultaneously. Java runtime system contains tools to support multiprocess synchronization and construct smoothly running interactive systems. Java supports Threading to modulate the task and is capable of handling it.
  • 11. High Performance Java performance is slower than C, because it handles more complicated task than C language. Incorporation of multithreading enhance the overall execution speed. Just-in-Time (JIT) can compile the byte code into machine code. Can sometimes be even faster than compiled C code. As it dose not include the library files as like C into the byteCode file, its linking & working is faster.
  • 12. Dynamic Capable of dynamically linking a new class libraries, methods and objects, with the OOPS pillar ‘Modularity’. Java can use efficient functions available in C/C++. Means it can connect the source code of C,C++ with its source code. Installing new version of library files, automatically updates all programs as the library is linked and not included.
  • 13. The C# Connection  The reach and power of Java continues to be felt in the world of computer language development.  Many of its innovative features, constructs, and concepts have become part of the baseline for any new language. The success of Java is simply too important to ignore.  Perhaps the most important example of Java‟s influence is C#. Created by Microsoft to support the .NET Framework, C# is closely related to Java. For example, both share the same general syntax, support distributed programming, and utilize the same object model.  There are, of course, differences between Java and C#, but the overall “look and feel” of these languages is very similar. This “cross-pollination” from Java to C# is the strongest testimonial to date that Java redefined the way we think about and use a computer language.
  • 14. Language of Internet Programming 1. Applets:  Special java program that can transmitted over the network and automatically executed by a java-compatible web browser or Applet runner. 2. Security:  Java compatible web browser can download java applets without fear of viral infection and malicious agent.  As the Applet dose not request for the main() function to run it, so it cannot hamper the computer system. No Admin rights provided to Applet. 3. Portable:  Java applets can be dynamically downloaded to all the various types of platforms connected to the internet.
  • 15. Why portable and Secure? The output of java compiler is not executable code. Once JVM exists for a platform, any java program can run on it. The execution of byte code by the JVM makes java programs portable. Actually for different platform separate JVM is made. Java program is limited within the java execution environment (JVM) and cannot access the other part of the computer. That why it is secure.
  • 16. Basics of Java Environments Java programs normally undergo five phases Edit Programmer writes program / source code (and stores program on disk in .java file). Compile Compiler creates bytecodes from source code (.class file) Load Class loader stores bytecodes in memory (it is part of JVM). There are 3 loaders in JVM – Bootstrap class loader Extensions class loader System class loader Verify Verifier ensures bytecodes do not violate security requirements Execute Interpreter translates bytecodes into machine language
  • 17. . . . . . . Primary Memory Disk Disk Disk Editor Compiler Class Loader Program is created in an editor and stored on disk in a file ending with .java. Compiler creates bytecodes and stores them on disk in a file ending with .class. Class loader reads .class files containing bytecodes from disk and puts those bytecodes in memory. Phase 1 Phase 2 Phase 3
  • 18. Primary Memory . . . . . . Bytecode Verifier Bytecode verifier confirms that all bytecodes are valid and do not violate Java‟s security restrictions. Phase 4 . . . . . . Interpreter Interpreter reads bytecodes and translates them into a language that the computer can understand, possibly storing data values as the program executes. Phase 5 Primary Memory
  • 19. Languages that JVM understand These languages are made with the help of Java but some of them are independent of JVM and some are not.
  • 20. Java Environment Development tools - part of java development kit (JDK). Runtime Environment – Java Runtime Environment. (JRE). Classes and methods - part of Java Standard Library (JSL), also known as Application Programming Interface (API). Inclusions in JDK: Appletviewer ( for viewing applets) Javac (Compiler) Java (Interpreter) Javap (Java disassembler) Javah (for C header files) Javadoc ( for creating HTML description) Jdb (Java Debugger)
  • 21. Java Environment (Cntd.) 2. Application Package Interface (API) Contains hundreds of classes and methods grouped into several functional packages: Language Support Package Utility Packages Input / Output Packages Networking Packages AWT Package Applet Package
  • 22. The Evolution of Java 1. Java 1.0 (January 23, 1996) 2. Java 1.1 (February 19, 1997) (Add new library, redefine applet handling and reconfigured many features.) 3. Java 2 (Second generation) (December 8, 1998) . Version no:1.2 (Internal version number of java library). Also known as J2SE [ Java 2 Platform Standard Edition]. - Add swing, the collection framework, enhanced JVM etc. 4. J2SE 1.3 (May 8, 2000) 5. J2SE 1.4 (February 6, 2002) 6. Java 5 (fifth generation). Version no: 1.5 (Internal version number of java library) (September 30, 2004) 7. Java 6 (sixth generation). Version no: 1.6 (Internal version number of java library) (December 11, 2006). 8. Java 7 (sixth generation). Version no: 1.7 (Internal version number of java library) (July 28, 2011)
  • 23. Versions of Java Three versions of the Java 2 Platform, targeted at different uses Java 2 Micro Edition (J2ME) Very small Java environment for smart cards, pages, phones, and set-top boxes Subset of the standard Java libraries aimed at limited size and processing power Java 2 Standard Edition (J2SE) The basic platform J2SE can be used to develop client-side standalone applications or applets. Java 2 Enterprise Edition (J2EE) For business applications, web services, mission-critical systems Transaction processing, databases, distribution, replication