SlideShare a Scribd company logo
Page 0Classification: Restricted
Core Java Training
Introduction to Java
Page 1Classification: Restricted
Agenda
• History of Java – A Programmer’s Perspective
• Salient Features of Java
• Major Java Editions
Page 2Classification: Restricted
Ice Breaking…
• Expectation setting…
• Bird’s eye view of the training…
Page 3Classification: Restricted
Introduction to Java
Page 4Classification: Restricted
European Agricultural Revolution: 1700 onwards
Page 5Classification: Restricted
Industrial Revolution
Page 6Classification: Restricted
Evolution of Computer Science – initially based on mechanical systems
Page 7Classification: Restricted
A point to ponder…
• What led to the evolution of electronic computation systems?
More specifically… When we already had mechanical computing
machines and calculators, what made us base the modern computing
systems on electronics?
Page 8Classification: Restricted
A point to ponder…
• What led to the evolution of electronic computation systems?
More specifically… When we already had mechanical computing
machines and calculators, what made us base the modern computing
systems on electronics?
• Switching speed.
• Wear and tear.
Page 9Classification: Restricted
Building Blocks of a Basic Modern Computer System
• Based on von Neumann architecture
• John von Neumann was a Hungarian computer scientist.
2
Page 10Classification: Restricted
A point to ponder…
• Ok, so the CPU is the brain of the computer system. Then why do I need an
OS?
Page 11Classification: Restricted
A point to ponder…
• Ok, so the CPU is the brain of the computer system. Then why do I need an
OS?
• Communicating with the CPU using its instruction set is cumbersome, it is
difficult. We need an interpreter.
Page 12Classification: Restricted
A point to ponder…
• Ok, an OS is the interface between the user and the CPU. Then why would I
need a programming language?
Page 13Classification: Restricted
A point to ponder…
• Ok, an OS is the interface between the user and the CPU. Then why would I
need a programming language?
• How would you add functionalities to the software that is not already
available in an OS?
Page 14Classification: Restricted
A point to ponder…
• Ok, agreed I would need a programming language. Now, that we already
had other languages like C for Procedural Programming, C++ for Object
Oriented Programming, why did we have to write another language like
Java?
Page 15Classification: Restricted
A point to ponder…
• Ok, agreed I would need a programming language. Now, that we already
had other languages like C for procedural programming, C++ for Object
Oriented Programming, why did we have to write another language like
Java?
• Necessity is the mother of invention. There is a business intent behind this
invention too. But, what is that requirement?
Page 16Classification: Restricted
The Compilation Process for Non-Java Programs (like C & C++)
Source Code
(programming
language
instructions)
Object Code
(binary
instructions)
Programmers write
this.
Computers run this.
Compilers
compile source
code into object
code.
Page 17Classification: Restricted
History of Java
• In the early 1990's, putting intelligence into home appliances was thought
to be the next "hot" technology.
• Examples of intelligent home appliances:
• Coffee pots and lights that can be controlled by a computer's programs.
• Televisions that can be controlled by an interactive television device's
programs.
• Anticipating a strong market for such things, Sun Microsystems in 1991
funded a research project (code named Green) whose goal was to develop
software for intelligent home appliances.
• An intelligent home appliance's intelligence comes from its embedded
processor chips and the software that runs on the processor chips.
• Appliance processor chips change often because engineers continually find
ways to make them smaller, less expensive, and more powerful.
• To handle the frequent turnover of new chips, appliance software must be
extremely portable.
Page 18Classification: Restricted
The Issue of Portability
• A piece of software is portable if it can be used on many different types of
computers.
• Object code is not very portable. As you know, object code is comprised of
binary-format instructions. Those binary-format instructions are intimately
tied to a particular type of computer. If you've got object code that was
created on a type X computer, then the object code can run only on a type
X computer.
• The Java solution to improve portability:
• Java compilers don't compile all the way down to object code. Instead,
they compile down to bytecode, which possesses the best features of
both object code and source code:
• Like object code, bytecode uses a format that works closely with
computer hardware, so it runs fast.
• Like source code, bytecode is generic, so it can be run on any type of
computer.
Page 19Classification: Restricted
The Compilation Process for Java Programs
Java source
code
object code
Java compilers
compile source code
into bytecode.
bytecode
When a Java program is
run, the JVM translates
bytecode to object code.
Page 20Classification: Restricted
Java Virtual Machine
• How can bytecode be run on any type of computer?
• As a Java program’s bytecode runs, the bytecode is translated into object
code by the computer's bytecode interpreter program. The bytecode
interpreter program is known as the Java Virtual Machine, or JVM for short.
The JVM is written specifically for every platform.
Page 21Classification: Restricted
Issue of Portability Solved.. But..
• Originally, Sun planned to use C++ for its home appliance software, but
they soon realized that C++ was less than ideal because it wasn't portable
enough and it relied too heavily on hard-to-maintain things called pointers.
• Thus, rather than write C++ software and fight C++'s inherent deficiencies,
Sun decided to develop a whole new programming language to handle its
home appliance software needs.
• Their new language was originally named Oak (for the tree that was outside
project leader James Gosling's window), but it was soon changed to Java.
• When the home appliance software work dried up, Java almost died before
being released.
• Fortunately for Java, the World Wide Web exploded in popularity and Sun
realized it could capitalize on that.
Page 22Classification: Restricted
Issue of Portability Solved.. But..
• Web pages have to be very portable because they can be downloaded onto
any type of computer.
• What's the standard language used for Web pages?
• Java programs are very portable and they're better than HTML in terms of
providing user interaction capabilities.
• Java programs that are embedded in Web pages are called applets.
• Although applets still play a significant role in Java's current success, some
of the other types of Java programs have surpassed applets in terms of
popularity.
• In this course, we cover Standard Edition (SE) Java applications. They are
Java programs that run on a standard computer – a desktop or a laptop,
without the need of the Internet.
19
Page 23Classification: Restricted
Features Of Java
• Simple
• Similar to C and C++, but without the demerits…
• Omits operator overloading, multiple inheritance
• Goto statement is eliminated
• Header files are eliminated
• No concept of pointers
• Automatic Garbage collection
• A rich set of predefined classes
Page 24Classification: Restricted
Features Of Java
• Object-Oriented
• Forces the programmer to use the classes and object
• Class
• Member variables( data ) and member functions ( methods )
Page 25Classification: Restricted
Features Of Java
• Robust
• designed for writing highly reliable or robust software:
• automatic garbage collection, which prevents memory leaks
• Type safety of data
• Extensive compile time and runtime checking
• Object Oriented Exception Handling of run time errors
• Divide by zero exception.
Page 26Classification: Restricted
Features Of Java
• Architectural Neutral and Interpreted
• compiler generates bytecodes
• Easy to interpret on any machine
• “Write once and run anywhere WORA”
Page 27Classification: Restricted
Features Of Java
• Powerful
• Networking
• Threads
• Distributed Objects
• Database Access
• Graphics
• Data structure library
• Serialization
• Digital Signatures
Page 28Classification: Restricted
Features Of Java
• Java is Popular
Page 29Classification: Restricted
Features Of Java
• Distributed
• Supports TCP/IP
• Remote Method
• Invocation (RMI)
• Web Services
Page 30Classification: Restricted
Features of Java
• Multi-Threaded
• Parallel processing to improve the performance of certain types of
programs
Page 31Classification: Restricted
Major Java Editions
Page 32Classification: Restricted
Setting up environment for
Java Development
MindsMapped Consulting
Page 33Classification: Restricted
Steps for Environment Setup
1. Download and install latest JDK from Oracle site
2. Download and install Eclipse
Page 34Classification: Restricted
Download latest JDK from Oracle site
• "JDK" or "JRE"?
JRE (Java Runtime) is needed for running Java programs. JDK (Java
Development Kit), which includes JRE plus the development tools (such as
compiler and debugger), is need for writing as well as running Java
programs. Since you are supposed to write Java Programs, you should
install JDK, which includes JRE.
• To download and install JDK follow the steps in the following slides.
Page 35Classification: Restricted
Download latest JDK from Oracle site – Step 0
Step 0: Un-Install Older Version(s) of JDK/JRE
• I recommend that you install only the latest JDK. Although you can install
multiple versions of JDK concurrently, it is messy.
• If you have previously installed older version(s) of JDK/JRE, un-install ALL of
them. Goto "Control Panel" ⇒ "Program and Features" ⇒ Un-install ALL
programs begin with "Java", such as "Java SE Development Kit ...", "Java SE
Runtime ...", and etc.
Page 36Classification: Restricted
Download latest JDK from Oracle site – Step 1
Step 1: Download JDK
1. Goto Java SE download site @
http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Under "Java Platform, Standard Edition" ⇒ "Java SE 8u{xx}", where {xx} is
the latest update number ⇒ Click the "JDK Download" button.
3. Check "Accept License Agreement".
4. Choose your operating platform, e.g., "Windows x64" (for 64-bit
Windows OS) or "Windows x86" (for 32-bit Windows OS). You can check
whether your Windows OS is 32-bit or 64-bit via "Control Panel" ⇒
"System" ⇒ Under "System Type".
Page 37Classification: Restricted
Download latest JDK from Oracle site – Step 2
Step 2: Install JDK and JRE
1. Run the downloaded installer (e.g., "jdk-8u{xx}-windows-x64.exe"),
which installs both the JDK and JRE. By default, the JDK will be installed
in directory "C:Program FilesJavajdk1.8.0_xx", where xx denotes the
latest upgrade number; and JRE in "C:Program FilesJavajre1.8.0_xx".
2. For novices, accept the defaults. Follow the screen instructions to install
JDK and JRE.
3. Check the JDK installed directory by inspecting these folders using File
Explorer. Take note of your JDK installed directory, which you will need
in the next step.
4. I shall refer to the installation directory as <JAVA_HOME>
Page 38Classification: Restricted
Download latest JDK from Oracle site – Step 3
Step 3: Include JDK's "bin" Directory in the PATH
Windows OS searches the current directory and the directories listed in the PATH environment
variable for executable programs. JDK's programs (such as Java compiler javac.exe and Java
runtime java.exe) reside in directory "<JAVA_HOME>bin" (where <JAVA_HOME> denotes the
JDK installed directory). You need to include "<JAVA_HOME>bin" in the PATH to run the JDK
programs.
To edit the PATH environment variable in Windows XP/Vista/7/8/10:
1. Launch "Control Panel" ⇒ "System" ⇒ Click "Advanced system settings".
2. Switch to "Advanced" tab ⇒ "Environment Variables".
3. Under "System Variables", scroll down to select "Path" ⇒ "Edit...".
4. (CAUTION: Read this paragraph 3 times before doing this step! There is no UNDO)
For Windows 10: You see a table listing the existing PATH entries. Click "New" ⇒ Enter the JDK's
binary directory "c:Program FilesJavajdk1.8.0_xxbin" (Replace xx with your installation's
upgrade number!!!) ⇒ Select "Move Up" to move it all the way to the top.
Prior to Windows 10: In "Variable value" field, INSERT "c:Program FilesJavajdk1.8.0_xxbin"
(Replace xx with your installation upgrade number!!!) IN FRONT of all the existing directories,
followed by a semi-colon (;) which separates the JDK's binary directory from the rest of the
existing directories. DO NOT DELETE any existing entries; otherwise, some existing applications
may not run.
Page 39Classification: Restricted
Download latest JDK from Oracle site – Step 4
Step 4: Verify the JDK Installation
Launch a CMD shell (Click "Start" button ⇒ run... ⇒ enter "cmd"; OR from "Start" button ⇒ All
Programs ⇒ Accessories ⇒ Command Prompt).
• Issue "path" command to list the contents of the PATH environment variable. Check to make
sure that your <JAVA_HOME>bin is listed in the PATH.
// Display the PATH entries
prompt> path
PATH=c:Program FilesJavajdk1.8.0_xxbin;[other entries...]
Don't type prompt>, which denotes the command prompt!!! Key in the command (highlighted)
only.
• Issue the following commands to verify that JDK/JRE are properly installed and display their
version:
// Display the JRE version
prompt> java -version
java version "1.8.0_xx"
Java(TM) SE Runtime Environment (build 1.8.0_xx-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
// Display the JDK version
prompt> javac -version
javac 1.8.0_xx
Page 40Classification: Restricted
Download and Install Eclipse
• Download Eclipse from:
http://www.eclipse.org/downloads/packages/release/Neon/2
* Neon is the latest Eclipse release as of today. You can download the
latest Eclipse release.
• To install, all you have to do is extract the zip folder.
• While starting Eclipse, choose a workspace to store all your project files.
• Once Eclipse is launched, point it to the JDK you installed earlier
Preferences -> Java -> Installed JRE's
Page 41Classification: Restricted
Topics to be covered in next session
• Principles of Object Oriented Programming
• Writing your first Java Application
• Elements of Java programming language
• Built in Data Types
• Conditional Statements
• Loops
Page 42Classification: Restricted
Thank you!

More Related Content

What's hot (20)

PPTX
Core Java Tutorials by Mahika Tutorials
Mahika Tutorials
 
PPTX
Introduction to java
Sandeep Rawat
 
PPT
Spring ppt
Mumbai Academisc
 
PPTX
Java Programming
Elizabeth alexander
 
PPT
Introduction to Java Programming, Basic Structure, variables Data type, input...
Mr. Akaash
 
PPTX
Apache tomcat
Shashwat Shriparv
 
PPT
Java tutorial PPT
Intelligo Technologies
 
PPTX
core java
Roushan Sinha
 
PPTX
Introduction to java
Java Lover
 
PPSX
Introduction of java
Madishetty Prathibha
 
PPTX
Core Java
NA
 
PPT
Java basic
Arati Gadgil
 
PPTX
Solid principles
Monica Rodrigues
 
PPTX
Introduction to Object Oriented Programming
Moutaz Haddara
 
PDF
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Edureka!
 
PDF
Introduction to Java Programming Language
jaimefrozr
 
PPTX
Spring boot
Gyanendra Yadav
 
PDF
Introduction to java (revised)
Sujit Majety
 
PPTX
Core java complete ppt(note)
arvind pandey
 
PPTX
Backend Programming
Ruwandi Madhunamali
 
Core Java Tutorials by Mahika Tutorials
Mahika Tutorials
 
Introduction to java
Sandeep Rawat
 
Spring ppt
Mumbai Academisc
 
Java Programming
Elizabeth alexander
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Mr. Akaash
 
Apache tomcat
Shashwat Shriparv
 
Java tutorial PPT
Intelligo Technologies
 
core java
Roushan Sinha
 
Introduction to java
Java Lover
 
Introduction of java
Madishetty Prathibha
 
Core Java
NA
 
Java basic
Arati Gadgil
 
Solid principles
Monica Rodrigues
 
Introduction to Object Oriented Programming
Moutaz Haddara
 
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Edureka!
 
Introduction to Java Programming Language
jaimefrozr
 
Spring boot
Gyanendra Yadav
 
Introduction to java (revised)
Sujit Majety
 
Core java complete ppt(note)
arvind pandey
 
Backend Programming
Ruwandi Madhunamali
 

Similar to Introduction to Java (20)

PPTX
Session 01 - Introduction to Java
PawanMM
 
PPTX
Introduction to Java Part-2
RatnaJava
 
PPTX
Session 02 - Elements of Java Language
PawanMM
 
PPTX
Introduction to Java
RatnaJava
 
PPTX
Java session2
Jigarthacker
 
PPTX
Object Oriented concept-JAVA-Module-1-PPT.pptx
ASHWINIGOWDA46
 
PPT
Core Java Slides
Vinit Vyas
 
PPSX
Java Semimar Slide (Cetpa)
Pratima Parida
 
PPSX
Java Semimar Slide (Cetpa)
Pratima Parida
 
PPTX
Object oriented programming-with_java
Hoang Nguyen
 
PPTX
Object oriented programming
Fraboni Ec
 
PPTX
Object oriented programming-with_java
Tony Nguyen
 
PPTX
Object oriented programming
Luis Goldster
 
PPTX
Object oriented programming-with_java
Harry Potter
 
PPTX
Object oriented programming
Young Alista
 
PPTX
Object oriented programming
James Wong
 
PPTX
1_Introduction to Java.pptx java programming
amitraj53904
 
PPTX
Introduction to Java Part-3
RatnaJava
 
PPT
Chapter 1 java
ahmed abugharsa
 
Session 01 - Introduction to Java
PawanMM
 
Introduction to Java Part-2
RatnaJava
 
Session 02 - Elements of Java Language
PawanMM
 
Introduction to Java
RatnaJava
 
Java session2
Jigarthacker
 
Object Oriented concept-JAVA-Module-1-PPT.pptx
ASHWINIGOWDA46
 
Core Java Slides
Vinit Vyas
 
Java Semimar Slide (Cetpa)
Pratima Parida
 
Java Semimar Slide (Cetpa)
Pratima Parida
 
Object oriented programming-with_java
Hoang Nguyen
 
Object oriented programming
Fraboni Ec
 
Object oriented programming-with_java
Tony Nguyen
 
Object oriented programming
Luis Goldster
 
Object oriented programming-with_java
Harry Potter
 
Object oriented programming
Young Alista
 
Object oriented programming
James Wong
 
1_Introduction to Java.pptx java programming
amitraj53904
 
Introduction to Java Part-3
RatnaJava
 
Chapter 1 java
ahmed abugharsa
 
Ad

More from Hitesh-Java (20)

PPSX
Spring - Part 4 - Spring MVC
Hitesh-Java
 
PPSX
Spring - Part 3 - AOP
Hitesh-Java
 
PPSX
Spring - Part 2 - Autowiring, Annotations, Java based Configuration - slides
Hitesh-Java
 
PPSX
Spring - Part 1 - IoC, Di and Beans
Hitesh-Java
 
PPSX
JSP - Part 2 (Final)
Hitesh-Java
 
PPSX
JSP - Part 1
Hitesh-Java
 
PPSX
Struts 2 - Hibernate Integration
Hitesh-Java
 
PPSX
Struts 2 - Introduction
Hitesh-Java
 
PPSX
Hibernate - Part 2
Hitesh-Java
 
PPSX
Hibernate - Part 1
Hitesh-Java
 
PPSX
JDBC Part - 2
Hitesh-Java
 
PPSX
JDBC
Hitesh-Java
 
PPSX
Java IO, Serialization
Hitesh-Java
 
PPSX
Inner Classes
Hitesh-Java
 
PPSX
Review Session - Part -2
Hitesh-Java
 
PPSX
Review Session and Attending Java Interviews
Hitesh-Java
 
PPSX
Collections - Lists, Sets
Hitesh-Java
 
PPSX
Collections - Sorting, Comparing Basics
Hitesh-Java
 
PPSX
Collections - Array List
Hitesh-Java
 
PPSX
Object Class
Hitesh-Java
 
Spring - Part 4 - Spring MVC
Hitesh-Java
 
Spring - Part 3 - AOP
Hitesh-Java
 
Spring - Part 2 - Autowiring, Annotations, Java based Configuration - slides
Hitesh-Java
 
Spring - Part 1 - IoC, Di and Beans
Hitesh-Java
 
JSP - Part 2 (Final)
Hitesh-Java
 
JSP - Part 1
Hitesh-Java
 
Struts 2 - Hibernate Integration
Hitesh-Java
 
Struts 2 - Introduction
Hitesh-Java
 
Hibernate - Part 2
Hitesh-Java
 
Hibernate - Part 1
Hitesh-Java
 
JDBC Part - 2
Hitesh-Java
 
Java IO, Serialization
Hitesh-Java
 
Inner Classes
Hitesh-Java
 
Review Session - Part -2
Hitesh-Java
 
Review Session and Attending Java Interviews
Hitesh-Java
 
Collections - Lists, Sets
Hitesh-Java
 
Collections - Sorting, Comparing Basics
Hitesh-Java
 
Collections - Array List
Hitesh-Java
 
Object Class
Hitesh-Java
 
Ad

Recently uploaded (20)

PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 

Introduction to Java

  • 1. Page 0Classification: Restricted Core Java Training Introduction to Java
  • 2. Page 1Classification: Restricted Agenda • History of Java – A Programmer’s Perspective • Salient Features of Java • Major Java Editions
  • 3. Page 2Classification: Restricted Ice Breaking… • Expectation setting… • Bird’s eye view of the training…
  • 5. Page 4Classification: Restricted European Agricultural Revolution: 1700 onwards
  • 7. Page 6Classification: Restricted Evolution of Computer Science – initially based on mechanical systems
  • 8. Page 7Classification: Restricted A point to ponder… • What led to the evolution of electronic computation systems? More specifically… When we already had mechanical computing machines and calculators, what made us base the modern computing systems on electronics?
  • 9. Page 8Classification: Restricted A point to ponder… • What led to the evolution of electronic computation systems? More specifically… When we already had mechanical computing machines and calculators, what made us base the modern computing systems on electronics? • Switching speed. • Wear and tear.
  • 10. Page 9Classification: Restricted Building Blocks of a Basic Modern Computer System • Based on von Neumann architecture • John von Neumann was a Hungarian computer scientist. 2
  • 11. Page 10Classification: Restricted A point to ponder… • Ok, so the CPU is the brain of the computer system. Then why do I need an OS?
  • 12. Page 11Classification: Restricted A point to ponder… • Ok, so the CPU is the brain of the computer system. Then why do I need an OS? • Communicating with the CPU using its instruction set is cumbersome, it is difficult. We need an interpreter.
  • 13. Page 12Classification: Restricted A point to ponder… • Ok, an OS is the interface between the user and the CPU. Then why would I need a programming language?
  • 14. Page 13Classification: Restricted A point to ponder… • Ok, an OS is the interface between the user and the CPU. Then why would I need a programming language? • How would you add functionalities to the software that is not already available in an OS?
  • 15. Page 14Classification: Restricted A point to ponder… • Ok, agreed I would need a programming language. Now, that we already had other languages like C for Procedural Programming, C++ for Object Oriented Programming, why did we have to write another language like Java?
  • 16. Page 15Classification: Restricted A point to ponder… • Ok, agreed I would need a programming language. Now, that we already had other languages like C for procedural programming, C++ for Object Oriented Programming, why did we have to write another language like Java? • Necessity is the mother of invention. There is a business intent behind this invention too. But, what is that requirement?
  • 17. Page 16Classification: Restricted The Compilation Process for Non-Java Programs (like C & C++) Source Code (programming language instructions) Object Code (binary instructions) Programmers write this. Computers run this. Compilers compile source code into object code.
  • 18. Page 17Classification: Restricted History of Java • In the early 1990's, putting intelligence into home appliances was thought to be the next "hot" technology. • Examples of intelligent home appliances: • Coffee pots and lights that can be controlled by a computer's programs. • Televisions that can be controlled by an interactive television device's programs. • Anticipating a strong market for such things, Sun Microsystems in 1991 funded a research project (code named Green) whose goal was to develop software for intelligent home appliances. • An intelligent home appliance's intelligence comes from its embedded processor chips and the software that runs on the processor chips. • Appliance processor chips change often because engineers continually find ways to make them smaller, less expensive, and more powerful. • To handle the frequent turnover of new chips, appliance software must be extremely portable.
  • 19. Page 18Classification: Restricted The Issue of Portability • A piece of software is portable if it can be used on many different types of computers. • Object code is not very portable. As you know, object code is comprised of binary-format instructions. Those binary-format instructions are intimately tied to a particular type of computer. If you've got object code that was created on a type X computer, then the object code can run only on a type X computer. • The Java solution to improve portability: • Java compilers don't compile all the way down to object code. Instead, they compile down to bytecode, which possesses the best features of both object code and source code: • Like object code, bytecode uses a format that works closely with computer hardware, so it runs fast. • Like source code, bytecode is generic, so it can be run on any type of computer.
  • 20. Page 19Classification: Restricted The Compilation Process for Java Programs Java source code object code Java compilers compile source code into bytecode. bytecode When a Java program is run, the JVM translates bytecode to object code.
  • 21. Page 20Classification: Restricted Java Virtual Machine • How can bytecode be run on any type of computer? • As a Java program’s bytecode runs, the bytecode is translated into object code by the computer's bytecode interpreter program. The bytecode interpreter program is known as the Java Virtual Machine, or JVM for short. The JVM is written specifically for every platform.
  • 22. Page 21Classification: Restricted Issue of Portability Solved.. But.. • Originally, Sun planned to use C++ for its home appliance software, but they soon realized that C++ was less than ideal because it wasn't portable enough and it relied too heavily on hard-to-maintain things called pointers. • Thus, rather than write C++ software and fight C++'s inherent deficiencies, Sun decided to develop a whole new programming language to handle its home appliance software needs. • Their new language was originally named Oak (for the tree that was outside project leader James Gosling's window), but it was soon changed to Java. • When the home appliance software work dried up, Java almost died before being released. • Fortunately for Java, the World Wide Web exploded in popularity and Sun realized it could capitalize on that.
  • 23. Page 22Classification: Restricted Issue of Portability Solved.. But.. • Web pages have to be very portable because they can be downloaded onto any type of computer. • What's the standard language used for Web pages? • Java programs are very portable and they're better than HTML in terms of providing user interaction capabilities. • Java programs that are embedded in Web pages are called applets. • Although applets still play a significant role in Java's current success, some of the other types of Java programs have surpassed applets in terms of popularity. • In this course, we cover Standard Edition (SE) Java applications. They are Java programs that run on a standard computer – a desktop or a laptop, without the need of the Internet. 19
  • 24. Page 23Classification: Restricted Features Of Java • Simple • Similar to C and C++, but without the demerits… • Omits operator overloading, multiple inheritance • Goto statement is eliminated • Header files are eliminated • No concept of pointers • Automatic Garbage collection • A rich set of predefined classes
  • 25. Page 24Classification: Restricted Features Of Java • Object-Oriented • Forces the programmer to use the classes and object • Class • Member variables( data ) and member functions ( methods )
  • 26. Page 25Classification: Restricted Features Of Java • Robust • designed for writing highly reliable or robust software: • automatic garbage collection, which prevents memory leaks • Type safety of data • Extensive compile time and runtime checking • Object Oriented Exception Handling of run time errors • Divide by zero exception.
  • 27. Page 26Classification: Restricted Features Of Java • Architectural Neutral and Interpreted • compiler generates bytecodes • Easy to interpret on any machine • “Write once and run anywhere WORA”
  • 28. Page 27Classification: Restricted Features Of Java • Powerful • Networking • Threads • Distributed Objects • Database Access • Graphics • Data structure library • Serialization • Digital Signatures
  • 29. Page 28Classification: Restricted Features Of Java • Java is Popular
  • 30. Page 29Classification: Restricted Features Of Java • Distributed • Supports TCP/IP • Remote Method • Invocation (RMI) • Web Services
  • 31. Page 30Classification: Restricted Features of Java • Multi-Threaded • Parallel processing to improve the performance of certain types of programs
  • 33. Page 32Classification: Restricted Setting up environment for Java Development MindsMapped Consulting
  • 34. Page 33Classification: Restricted Steps for Environment Setup 1. Download and install latest JDK from Oracle site 2. Download and install Eclipse
  • 35. Page 34Classification: Restricted Download latest JDK from Oracle site • "JDK" or "JRE"? JRE (Java Runtime) is needed for running Java programs. JDK (Java Development Kit), which includes JRE plus the development tools (such as compiler and debugger), is need for writing as well as running Java programs. Since you are supposed to write Java Programs, you should install JDK, which includes JRE. • To download and install JDK follow the steps in the following slides.
  • 36. Page 35Classification: Restricted Download latest JDK from Oracle site – Step 0 Step 0: Un-Install Older Version(s) of JDK/JRE • I recommend that you install only the latest JDK. Although you can install multiple versions of JDK concurrently, it is messy. • If you have previously installed older version(s) of JDK/JRE, un-install ALL of them. Goto "Control Panel" ⇒ "Program and Features" ⇒ Un-install ALL programs begin with "Java", such as "Java SE Development Kit ...", "Java SE Runtime ...", and etc.
  • 37. Page 36Classification: Restricted Download latest JDK from Oracle site – Step 1 Step 1: Download JDK 1. Goto Java SE download site @ http://www.oracle.com/technetwork/java/javase/downloads/index.html 2. Under "Java Platform, Standard Edition" ⇒ "Java SE 8u{xx}", where {xx} is the latest update number ⇒ Click the "JDK Download" button. 3. Check "Accept License Agreement". 4. Choose your operating platform, e.g., "Windows x64" (for 64-bit Windows OS) or "Windows x86" (for 32-bit Windows OS). You can check whether your Windows OS is 32-bit or 64-bit via "Control Panel" ⇒ "System" ⇒ Under "System Type".
  • 38. Page 37Classification: Restricted Download latest JDK from Oracle site – Step 2 Step 2: Install JDK and JRE 1. Run the downloaded installer (e.g., "jdk-8u{xx}-windows-x64.exe"), which installs both the JDK and JRE. By default, the JDK will be installed in directory "C:Program FilesJavajdk1.8.0_xx", where xx denotes the latest upgrade number; and JRE in "C:Program FilesJavajre1.8.0_xx". 2. For novices, accept the defaults. Follow the screen instructions to install JDK and JRE. 3. Check the JDK installed directory by inspecting these folders using File Explorer. Take note of your JDK installed directory, which you will need in the next step. 4. I shall refer to the installation directory as <JAVA_HOME>
  • 39. Page 38Classification: Restricted Download latest JDK from Oracle site – Step 3 Step 3: Include JDK's "bin" Directory in the PATH Windows OS searches the current directory and the directories listed in the PATH environment variable for executable programs. JDK's programs (such as Java compiler javac.exe and Java runtime java.exe) reside in directory "<JAVA_HOME>bin" (where <JAVA_HOME> denotes the JDK installed directory). You need to include "<JAVA_HOME>bin" in the PATH to run the JDK programs. To edit the PATH environment variable in Windows XP/Vista/7/8/10: 1. Launch "Control Panel" ⇒ "System" ⇒ Click "Advanced system settings". 2. Switch to "Advanced" tab ⇒ "Environment Variables". 3. Under "System Variables", scroll down to select "Path" ⇒ "Edit...". 4. (CAUTION: Read this paragraph 3 times before doing this step! There is no UNDO) For Windows 10: You see a table listing the existing PATH entries. Click "New" ⇒ Enter the JDK's binary directory "c:Program FilesJavajdk1.8.0_xxbin" (Replace xx with your installation's upgrade number!!!) ⇒ Select "Move Up" to move it all the way to the top. Prior to Windows 10: In "Variable value" field, INSERT "c:Program FilesJavajdk1.8.0_xxbin" (Replace xx with your installation upgrade number!!!) IN FRONT of all the existing directories, followed by a semi-colon (;) which separates the JDK's binary directory from the rest of the existing directories. DO NOT DELETE any existing entries; otherwise, some existing applications may not run.
  • 40. Page 39Classification: Restricted Download latest JDK from Oracle site – Step 4 Step 4: Verify the JDK Installation Launch a CMD shell (Click "Start" button ⇒ run... ⇒ enter "cmd"; OR from "Start" button ⇒ All Programs ⇒ Accessories ⇒ Command Prompt). • Issue "path" command to list the contents of the PATH environment variable. Check to make sure that your <JAVA_HOME>bin is listed in the PATH. // Display the PATH entries prompt> path PATH=c:Program FilesJavajdk1.8.0_xxbin;[other entries...] Don't type prompt>, which denotes the command prompt!!! Key in the command (highlighted) only. • Issue the following commands to verify that JDK/JRE are properly installed and display their version: // Display the JRE version prompt> java -version java version "1.8.0_xx" Java(TM) SE Runtime Environment (build 1.8.0_xx-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode) // Display the JDK version prompt> javac -version javac 1.8.0_xx
  • 41. Page 40Classification: Restricted Download and Install Eclipse • Download Eclipse from: http://www.eclipse.org/downloads/packages/release/Neon/2 * Neon is the latest Eclipse release as of today. You can download the latest Eclipse release. • To install, all you have to do is extract the zip folder. • While starting Eclipse, choose a workspace to store all your project files. • Once Eclipse is launched, point it to the JDK you installed earlier Preferences -> Java -> Installed JRE's
  • 42. Page 41Classification: Restricted Topics to be covered in next session • Principles of Object Oriented Programming • Writing your first Java Application • Elements of Java programming language • Built in Data Types • Conditional Statements • Loops