Module 1
• Java was originally developed by James
Gosling at Sun Microsystems (which has since
been acquired by Oracle) and released in 1995
• The latest version of Java is Java SE 14
released on March 2020
Java Buzzwords
Object- Oriented
• Java is an object-oriented programming
language
• In Java, everything is an object which has some
state and behavior.
Simple
• Java is easy to learn. Java language is a simple
programming language because:
 Java inherits the C++ syntax and many of
the object-oriented features of C++.
 Pointers , operator overloading are not
there in Java.
 There is no need to remove unreferenced
objects because there is an Automatic
Garbage Collection in Java.
Secure
• Java virtual machine verifies the byte-code
before executing it. There are cases when a
program jumps to wrong locations that can
hold malicious data.
• The JVM guarantees that such kind of unsafe
operations do not exist.
• Java does not support pointers concept, which
further enhances the security of java. Through
pointers one can reference some arbitrary
memory locations to do unauthorized read
Platform Independent
Platform Independent
• Java code is compiled by the compiler and
converted into byte code.
• This byte code is a platform-independent code
because it can be run on multiple platforms,
i.e., Write Once and Run Anywhere(WORA).
Robust
• Robust means reliability and no other
language other than java assure this.
• It provides the powerful exception handling
and type checking mechanism.
• 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 is a lack of pointers that avoids security
problems
Portable
• Portability means program written on one
type of machine can be executed on a wide
variety of machines.
• As java bytecodes are architecture and OS
independent , they are highly portable and
can be executed on any machine without any
change
Dynamic
• Java is a dynamic language. It supports
dynamic loading of classes.
• It also supports dynamic linking. A java
application can be linked to a library at run
time.
• Native method library (contains native
methods) are linked at runtime.
Architecture neutral
• Byte-code is not dependent on any machine
architecture. Java compiler generates byte
code which can be executed on any processor
with the presence of JVM
• In Java, the size of the primitive data types
is machine-independent, which were
dependent in the case of C/C++.
• Moreover, any changes and updates made in
Operating Systems, Processors and System
resources will not enforce any changes in Java
High Performance
• Java is an interpreted language ,so it will never
be as fast as a compiled languages like C,C++.
• But Java enables high performance with the
use of Just-In-Time compiler.
• Just-In-Time compiler , which is a part of JVM
, is a program that converts a portion of
bytecodes into machine code which is then
executed by the processor
Multithreading
• Java multithreading feature makes it possible
to write a program that can do multiple tasks
simultaneously.
Distributed
• Java is distributed because it facilitates users
to create distributed applications in Java.
• RMI and EJB are used for creating distributed
applications.
• A distributed application is software that is
executed or run on multiple computers
interconnected by means of a network. These
applications interact in order to achieve a
specific goal or task.
JVM
• The main components of JVM are
 CLASS LOADER : loads all necessary classes
needed for the execution of the program
 BYTECODE VERIFIER : will verify whether the
generated bytecode is proper or not.
EXECUTION ENGINE: executes the bytecode
• The compiler will compile the three files and
produces 3 corresponding .class file which
consists of BYTE code.
• The Java VM or Java Virtual Machine resides
on the RAM. During execution, using the class
loader the class files are brought on the RAM.
The BYTE code is verified for any security
breaches.
Java Runtime Environment(JRE)
• Provides environment only to run the java
program.
• JRE comprises of JVM and a set of libraries
JVM + Libraries set
JRE
JDK
• Stands for Java Development Kit
• Provides the environment to develop and
execute the java program
• JDK comprises of JRE and Development tools
JVM +
Library
Set
+ Development Tools
JDK
Java Programming Language
Platforms
 There are four platforms of the Java
programming language:
 Java Platform, Standard Edition (Java
SE)
 Java Platform, Enterprise Edition (Java
EE)
 Java Platform, Micro Edition (Java ME)
 Java FX
 Java SE
 provides the core functionality of the
Java programming
 defines everything from the basic types
and objects to high-level classes that are
used for networking, security, database
access and GUI development.
 Java EE
 Java EE platform is built on top of the
Java SE platform
 provides an API and runtime
environment for developing and running
large-scale,scalable, reliable, and secure
network applications.
 Java ME
 provides an API and a virtual machine
 Java FX
 platform for creating rich internet
applications written in Java FX Script.
 Java FX Script is a language that is
compiled to Java technology bytecode,
which can then be run on a Java VM
 Applications written for the Java FX
platform can include and link to Java
programming language classes.
Object Oriented Concepts
 Object
 Class
 Abstraction
 Polymorphism
 Inheritance
 Encapsulation
Object
 Any entity that has state and behavior is
known as an object.
 An object contains an address and takes
up some space in memory.
 It can be physical or logical.
 It is an instance of a class.
 Examples??????
Class and Encapsulation
 Collection of objects -:class.
 Class doesn't consume any space.
 Defines the structure and behavior
that will be shared by a set of objects.
 Encapsulation:bind together code and
data it manipulates
 Data :Member variable
 Code that operates on data:Methods
Inheritance and Abstraction
 One object acquires the properties of
another object.
 Inherit general attributes from its parents.
 Abstraction is a process where you show
only “relevant” data and “hide”
unnecessary details of an object from the
user.
Polymorphism
 “Many forms”
 One interface to be used for a general
class of actions.
 Expressed by one interface and multiple
methods.
 Complexity can be avoided.

1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf

  • 1.
  • 2.
    • Java wasoriginally developed by James Gosling at Sun Microsystems (which has since been acquired by Oracle) and released in 1995 • The latest version of Java is Java SE 14 released on March 2020
  • 3.
  • 4.
    Object- Oriented • Javais an object-oriented programming language • In Java, everything is an object which has some state and behavior.
  • 5.
    Simple • Java iseasy to learn. Java language is a simple programming language because:  Java inherits the C++ syntax and many of the object-oriented features of C++.  Pointers , operator overloading are not there in Java.  There is no need to remove unreferenced objects because there is an Automatic Garbage Collection in Java.
  • 6.
    Secure • Java virtualmachine verifies the byte-code before executing it. There are cases when a program jumps to wrong locations that can hold malicious data. • The JVM guarantees that such kind of unsafe operations do not exist. • Java does not support pointers concept, which further enhances the security of java. Through pointers one can reference some arbitrary memory locations to do unauthorized read
  • 7.
  • 8.
    Platform Independent • Javacode is compiled by the compiler and converted into byte code. • This byte code is a platform-independent code because it can be run on multiple platforms, i.e., Write Once and Run Anywhere(WORA).
  • 9.
    Robust • Robust meansreliability and no other language other than java assure this. • It provides the powerful exception handling and type checking mechanism. • 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 is a lack of pointers that avoids security problems
  • 10.
    Portable • Portability meansprogram written on one type of machine can be executed on a wide variety of machines. • As java bytecodes are architecture and OS independent , they are highly portable and can be executed on any machine without any change
  • 11.
    Dynamic • Java isa dynamic language. It supports dynamic loading of classes. • It also supports dynamic linking. A java application can be linked to a library at run time. • Native method library (contains native methods) are linked at runtime.
  • 12.
    Architecture neutral • Byte-codeis not dependent on any machine architecture. Java compiler generates byte code which can be executed on any processor with the presence of JVM • In Java, the size of the primitive data types is machine-independent, which were dependent in the case of C/C++. • Moreover, any changes and updates made in Operating Systems, Processors and System resources will not enforce any changes in Java
  • 13.
    High Performance • Javais an interpreted language ,so it will never be as fast as a compiled languages like C,C++. • But Java enables high performance with the use of Just-In-Time compiler. • Just-In-Time compiler , which is a part of JVM , is a program that converts a portion of bytecodes into machine code which is then executed by the processor
  • 14.
    Multithreading • Java multithreadingfeature makes it possible to write a program that can do multiple tasks simultaneously.
  • 15.
    Distributed • Java isdistributed because it facilitates users to create distributed applications in Java. • RMI and EJB are used for creating distributed applications. • A distributed application is software that is executed or run on multiple computers interconnected by means of a network. These applications interact in order to achieve a specific goal or task.
  • 16.
    JVM • The maincomponents of JVM are  CLASS LOADER : loads all necessary classes needed for the execution of the program  BYTECODE VERIFIER : will verify whether the generated bytecode is proper or not. EXECUTION ENGINE: executes the bytecode
  • 18.
    • The compilerwill compile the three files and produces 3 corresponding .class file which consists of BYTE code. • The Java VM or Java Virtual Machine resides on the RAM. During execution, using the class loader the class files are brought on the RAM. The BYTE code is verified for any security breaches.
  • 21.
    Java Runtime Environment(JRE) •Provides environment only to run the java program. • JRE comprises of JVM and a set of libraries JVM + Libraries set JRE
  • 22.
    JDK • Stands forJava Development Kit • Provides the environment to develop and execute the java program • JDK comprises of JRE and Development tools JVM + Library Set + Development Tools JDK
  • 23.
    Java Programming Language Platforms There are four platforms of the Java programming language:  Java Platform, Standard Edition (Java SE)  Java Platform, Enterprise Edition (Java EE)  Java Platform, Micro Edition (Java ME)  Java FX
  • 24.
     Java SE provides the core functionality of the Java programming  defines everything from the basic types and objects to high-level classes that are used for networking, security, database access and GUI development.
  • 25.
     Java EE Java EE platform is built on top of the Java SE platform  provides an API and runtime environment for developing and running large-scale,scalable, reliable, and secure network applications.  Java ME  provides an API and a virtual machine
  • 26.
     Java FX platform for creating rich internet applications written in Java FX Script.  Java FX Script is a language that is compiled to Java technology bytecode, which can then be run on a Java VM  Applications written for the Java FX platform can include and link to Java programming language classes.
  • 27.
    Object Oriented Concepts Object  Class  Abstraction  Polymorphism  Inheritance  Encapsulation
  • 28.
    Object  Any entitythat has state and behavior is known as an object.  An object contains an address and takes up some space in memory.  It can be physical or logical.  It is an instance of a class.  Examples??????
  • 29.
    Class and Encapsulation Collection of objects -:class.  Class doesn't consume any space.  Defines the structure and behavior that will be shared by a set of objects.  Encapsulation:bind together code and data it manipulates  Data :Member variable  Code that operates on data:Methods
  • 30.
    Inheritance and Abstraction One object acquires the properties of another object.  Inherit general attributes from its parents.  Abstraction is a process where you show only “relevant” data and “hide” unnecessary details of an object from the user.
  • 31.
    Polymorphism  “Many forms” One interface to be used for a general class of actions.  Expressed by one interface and multiple methods.  Complexity can be avoided.