KEMBAR78
Java - At a glance | PDF
Java – At a Glance
By :- Er Nitish Baranwal
 What is Java?
 Evolution of Java
 Versions of Java
 Application of Java
 Features of Java
 Advantages of Java
 Java Working Model
 Java Virtual Machine
 Java Runtime Environment
 Java Development Kit
 Setting up Java Environment
 “Hello Java” Program
 Demonstration of “Hello Java” Program
 Things to Take Away
Contents
 Java is a high level, object-oriented, class-based,
concurrent, secured and general-purpose programming
language.
 Java is a robust technology.
 It has WORA capabilities i.e. “Write once, Run anywhere”.
What is Java?
 Java was developed by James Gosling and his Green Team
at Sun Microsystems (which is now merged in Oracle
Corporation) in June 1991. Patrick Naughton, Chrish Warth,
Mike Sheridan and Ed Frank were the helping hands in this
project.
 It took around 18 months and had an initial name as Oak
which was renamed to Java in 1995, due to copyright
issues. JDK 1.0 released in (January 23, 1996). Java SE 10 is a
current stable release of Java, and many other previous
Java versions are also available.
Evolution of Java
 JDK Alpha and Beta (1995)
 JDK 1.0 (23rd Jan, 1996)
 JDK 1.1 (19th Feb, 1997)
 J2SE 1.2 (8th Dec, 1998)
 J2SE 1.3 (8th May, 2000)
 J2SE 1.4 (6th Feb, 2002)
 J2SE 5.0 (30th Sep, 2004)
 Java SE 6 (11th Dec, 2006)
 Java SE 7 (28th July, 2011)
 Java SE 8 (18th March, 2014)
 Java SE 9 (21st Sep, 2017)
 Java SE 10 (20th March, 2018)
Versions of Java
 Desktop GUI Applications
 Mobile Applications
 Embedded Systems
 Web Applications
 Enterprise Applications
 Scientific Applications
Applications of Java
 Java is Simple
 Java is Object Oriented
 Java is Platform Independent
 Java is Secured
 Java is Robust
 Java is Portable
 Java is Interpreted
 Java is Dynamic
 Java is Multi-threaded
 Java is Architecture Neutral
 Java is Distributed
 Java is High in Performance
Features of Java
 Java offers higher cross- functionality and portability as
programs written in one platform can run across desktops,
mobiles, embedded systems.
 Java is free, simple, object-oriented, distributed, supports
multithreading and offers multimedia and network support.
 Java is a mature language, therefore more stable and
predictable. The Java Class Library enables cross-platform
development.
 Being highly popular at enterprise, embedded and network
level, Java has a large active user community and support
available.
Advantages of Java - 1
 Unlike C and C++, Java programs are compiled independent of
platform in bytecode language which allows the same program
to run on any machine that has a JVM installed.
 Java has powerful development tools like Eclipse SDK and
NetBeans which have debugging capability and offer integrated
development environment.
 Increasing language diversity, evidenced by compatibility of Java
with Scala, Groovy, JRuby, and Clojure.
 Relatively seamless forward compatibility from one version to
the next
Advantages of Java - 2
Java Working Model
Java
Source
Code
Java
Compiler
Java Byte
Codes
Java
Byte
code
moves
Locally
or
through
Networ
k
Java Class
loader,
Byte code
Verifier
JVM
Operating
Systems
Java Class
Library
Hardware
 Java Virtual Machine (JVM) is an abstract machine or engine that
executes Java byte code. It is a platform dependent. Java
Applications run only on those machines which have JVM.
Java Virtual Machine
 The Java Runtime Environment (JRE) is a set of tools used for
developing Java Applications. It comprises of runtime
interpreter, class loader, Java Library containing Java APIs (core
classes) and other files that are required by the JVM at runtime.
Java Runtime Environment
JVM
Set of Libraries
Eg. rt.jar etc.
Other Files
 Java Development Kit (JDK) is a software development
environment which allows us to develop Java Applications. It
comprises of Java Runtime Environment (JRE), an
interpreter/loader (Java), a compiler (javac), an archiver (jar), a
documentation generator (Javadoc) and other tools needed in
Java development.
Java Development Kit
Development Tools
Eg.- javac, java,
appletviewer,
javadoc, jar etc.
JRE
 Setting up for Windows
Assuming you have installed Java in c:Program Filesjavajdk directory −
 Right-click on ‘My Computer’ and select ‘Properties’.
 Click the ‘Environment variables’ button under the ‘Advanced’ tab.
 Now, alter the ‘Path’ variable so that it also contains the path to the
Java executable. Example :- ‘c:Program Filesjavajdkbin’.
 Setting up for Linux
Assuming you have installed the JDK in the home directory under Root
(/home).
 Execute the following line:-
export PATH=$PATH:/home/jdk1.7.0_21/bin/
Setting up Java Environment
 A “Hello Java” program is a simple Java program that outputs
“Hello Java!” on the screen.
 Let’s explore the “Hello Java” Program.
class HelloJava
{
public static void main(String[] args)
{
System.out.println(“Hello Java!”);
}
}
To Compile:- javac HelloJava.java
To Run:- java HelloJava
“Hello Java” Program
 In Java, you need Text Editor like Notepad or any IDE (NetBeans,
Eclipse etc.) to write your Java Program.
 In Java, every program or application begin with class definition. In
our program, HelloJava is the name of the class and the name of the
class should be same as the filename in Java.
 In java, every program or application must contain main method. It
is the entry point of the program from where the execution of the
java code takes place. It is mandatory.
 In Java, System.out.println(“”) is used to display the output on the
screen.
Demonstration of “Hello Java” Program
 Every Java program or Application must have class definition
which matches the filename.
 This class definition must have a main method in it.
 The execution of the code takes place from the main method.
 When you run the Java program, Java compiler first compiles
your Java code to bytecode. Then, the JVM translates bytecode
into native machine code (set of instructions that a computer's
CPU executes directly).
Things to Take Away
Thank You
Keep Smiling! Keep Learning!

Java - At a glance

  • 1.
    Java – Ata Glance By :- Er Nitish Baranwal
  • 2.
     What isJava?  Evolution of Java  Versions of Java  Application of Java  Features of Java  Advantages of Java  Java Working Model  Java Virtual Machine  Java Runtime Environment  Java Development Kit  Setting up Java Environment  “Hello Java” Program  Demonstration of “Hello Java” Program  Things to Take Away Contents
  • 3.
     Java isa high level, object-oriented, class-based, concurrent, secured and general-purpose programming language.  Java is a robust technology.  It has WORA capabilities i.e. “Write once, Run anywhere”. What is Java?
  • 4.
     Java wasdeveloped by James Gosling and his Green Team at Sun Microsystems (which is now merged in Oracle Corporation) in June 1991. Patrick Naughton, Chrish Warth, Mike Sheridan and Ed Frank were the helping hands in this project.  It took around 18 months and had an initial name as Oak which was renamed to Java in 1995, due to copyright issues. JDK 1.0 released in (January 23, 1996). Java SE 10 is a current stable release of Java, and many other previous Java versions are also available. Evolution of Java
  • 5.
     JDK Alphaand Beta (1995)  JDK 1.0 (23rd Jan, 1996)  JDK 1.1 (19th Feb, 1997)  J2SE 1.2 (8th Dec, 1998)  J2SE 1.3 (8th May, 2000)  J2SE 1.4 (6th Feb, 2002)  J2SE 5.0 (30th Sep, 2004)  Java SE 6 (11th Dec, 2006)  Java SE 7 (28th July, 2011)  Java SE 8 (18th March, 2014)  Java SE 9 (21st Sep, 2017)  Java SE 10 (20th March, 2018) Versions of Java
  • 6.
     Desktop GUIApplications  Mobile Applications  Embedded Systems  Web Applications  Enterprise Applications  Scientific Applications Applications of Java
  • 7.
     Java isSimple  Java is Object Oriented  Java is Platform Independent  Java is Secured  Java is Robust  Java is Portable  Java is Interpreted  Java is Dynamic  Java is Multi-threaded  Java is Architecture Neutral  Java is Distributed  Java is High in Performance Features of Java
  • 8.
     Java offershigher cross- functionality and portability as programs written in one platform can run across desktops, mobiles, embedded systems.  Java is free, simple, object-oriented, distributed, supports multithreading and offers multimedia and network support.  Java is a mature language, therefore more stable and predictable. The Java Class Library enables cross-platform development.  Being highly popular at enterprise, embedded and network level, Java has a large active user community and support available. Advantages of Java - 1
  • 9.
     Unlike Cand C++, Java programs are compiled independent of platform in bytecode language which allows the same program to run on any machine that has a JVM installed.  Java has powerful development tools like Eclipse SDK and NetBeans which have debugging capability and offer integrated development environment.  Increasing language diversity, evidenced by compatibility of Java with Scala, Groovy, JRuby, and Clojure.  Relatively seamless forward compatibility from one version to the next Advantages of Java - 2
  • 10.
    Java Working Model Java Source Code Java Compiler JavaByte Codes Java Byte code moves Locally or through Networ k Java Class loader, Byte code Verifier JVM Operating Systems Java Class Library Hardware
  • 11.
     Java VirtualMachine (JVM) is an abstract machine or engine that executes Java byte code. It is a platform dependent. Java Applications run only on those machines which have JVM. Java Virtual Machine
  • 12.
     The JavaRuntime Environment (JRE) is a set of tools used for developing Java Applications. It comprises of runtime interpreter, class loader, Java Library containing Java APIs (core classes) and other files that are required by the JVM at runtime. Java Runtime Environment JVM Set of Libraries Eg. rt.jar etc. Other Files
  • 13.
     Java DevelopmentKit (JDK) is a software development environment which allows us to develop Java Applications. It comprises of Java Runtime Environment (JRE), an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc) and other tools needed in Java development. Java Development Kit Development Tools Eg.- javac, java, appletviewer, javadoc, jar etc. JRE
  • 14.
     Setting upfor Windows Assuming you have installed Java in c:Program Filesjavajdk directory −  Right-click on ‘My Computer’ and select ‘Properties’.  Click the ‘Environment variables’ button under the ‘Advanced’ tab.  Now, alter the ‘Path’ variable so that it also contains the path to the Java executable. Example :- ‘c:Program Filesjavajdkbin’.  Setting up for Linux Assuming you have installed the JDK in the home directory under Root (/home).  Execute the following line:- export PATH=$PATH:/home/jdk1.7.0_21/bin/ Setting up Java Environment
  • 15.
     A “HelloJava” program is a simple Java program that outputs “Hello Java!” on the screen.  Let’s explore the “Hello Java” Program. class HelloJava { public static void main(String[] args) { System.out.println(“Hello Java!”); } } To Compile:- javac HelloJava.java To Run:- java HelloJava “Hello Java” Program
  • 16.
     In Java,you need Text Editor like Notepad or any IDE (NetBeans, Eclipse etc.) to write your Java Program.  In Java, every program or application begin with class definition. In our program, HelloJava is the name of the class and the name of the class should be same as the filename in Java.  In java, every program or application must contain main method. It is the entry point of the program from where the execution of the java code takes place. It is mandatory.  In Java, System.out.println(“”) is used to display the output on the screen. Demonstration of “Hello Java” Program
  • 17.
     Every Javaprogram or Application must have class definition which matches the filename.  This class definition must have a main method in it.  The execution of the code takes place from the main method.  When you run the Java program, Java compiler first compiles your Java code to bytecode. Then, the JVM translates bytecode into native machine code (set of instructions that a computer's CPU executes directly). Things to Take Away
  • 18.