SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a Java Lecture 1

Semelhante a 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
 

Último

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 

Último (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

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