SlideShare una empresa de Scribd logo
1 de 62
JAVA LANGUAGE:
a gentle introduction
fabio.ferraguto@gmail.com
 I n t r o du c t i o n
 G e t t i ng S t a r t e d
Object Oriented
P a rt 1
In t rod u c ti o n
1991 OAK
January 23 1996
  version 1.0


http://www.java.com/en/javahistory
INTRODUCTION
     to
JAVA UNIVERSE
Wh a t’ s J A V A ?
Language
Runtime
Environment
Standard
  Tools
F ea tu r e s
Simple
Object Oriented
Interpreted
Architecture
Neutral
Portable
Robust
Distributed
Secure
Dynamic
Concurrent
Rich
Garbage
Collector
Java
Development

Kit
JD K   Java AP I



JR E     JV M
JRE                                    JDK
    (Java Runtime environment)             (Java Development Toolkit)
It is an implementation of the Java    It is a bundle of software that you can
Virtual Machine* which actually        use to develop Java based
executes Java programs.                applications.
Java Run Time Environment is a plug- Java Development Kit is needed for
in needed for running java programs. developing java applications.
JRE is smaller than JDK so it needs    JDK needs more Disk space as it
less Disk space.                       contains JRE along with various
                                       development tools.
JRE can be downloaded/supported        JDK can be downloaded/supported
freely from                            freely from
java.com                               java.sun.com
It includes JVM , Core libraries and   It includes JRE, set of API classes,
other additional components to run     Java compiler, Webstart and
applications and applets written in    additional files needed to write Java
Java.                                  applets and applications.
“An imaginary machine that is
 Virtual Machine
implemented by emulating it in
software on a real machine.
Code for the java virtual machine
is stored in .class files, each on
which contains code for at most
one public class.”


       da “The Java Virtual Machine Specification”
Pa rt 2
G e t ti n g S t a r te d
My first Java program

1. public class Hello {
2.   // entry point
3.   public static void main(String[] args){
4.        System.out.println("Hello World!");
5.   }
6. }
My first Java program


Step 1: Open a text editor

Step 2: Open a console (prompt dos/unix)

Step 3: Write the code in text editor

Step 4: Save as Hello.java
My first Java program



Step 5: Compile
          javac Hello.java
My first Java program



Step 6: Execute
          java Hello
My first Java program

1. public class Hello {
2.   // entry point
3.   public static void main(String[] args){
4.        System.out.println("Hello World!");
5.   }
6. }
My first Java program

1. public class Hello {
2.   // entry point
3.   public static void main(String[] args){
4.        System.out.println("Hello World!");
5.   }
6. }
My first Java program

1. public class Hello {
2.   // entry point
3.   public static void main(String[] args){
4.        System.out.println("Hello World!");
5.   }
6. }
My first Java program

1. public class Hello {
2.   // entry point
3.   public static void main(String[] args){
4.        System.out.println("Hello World!");
5.   }
6. }
Pa rt 3
Object Oriented
Par o gr a m m i n g
   P ar a d i gm s
Processes
Machine
EXAMPLE: ORANGE SQUEEZER




Rube Goldberg, Inventions of Professor Lucifer Butts, 1932
“… nel progettare una sequenza codificata, quello che
 bisogna avere innanzitutto in mente non è l’apparenza
      originale della sequenza, ma piuttosto il suo
funzionamento e il suo continuo cambiamento mentre il
processo che essa controlla procede nel suo corso. …

    È dunque consigliabile incominciare la progettazione
dalla fine, e cioè progettare per prima cosa il corso del
processo e la relazione delle sue fasi successive con il
   codice che cambia, e quindi estrarre la sequenza
        codificata come operazione successiva.”
                            Goldstine & Von Neumann, 1947
“… Questi “linguaggi di Von-Neumann” creano
  dei blocchi stradali mentali enormi e non
  necessari nel pensare i programmi e nel
  creare le combinazioni di alto livello richieste
  da una metodologia di programmazione
  veramente potente. …”

                              John Backus, 1978
Things
Object Oriented
O b j e c ts ?
Class
Objects
Interface
C on c e pt s
   A nd
 F ea tu r e s
Classification
Activation
Encapsulation
Information
   Hiding
Inheritance
Composition
Polymorphism
Taxonomies
Multiple
Inheritance
Reuse

Más contenido relacionado

La actualidad más candente

Blog ingles pdf.1
Blog ingles pdf.1Blog ingles pdf.1
Blog ingles pdf.1
negroronny
 

La actualidad más candente (10)

Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Java
JavaJava
Java
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
 
Threads presentation
Threads presentationThreads presentation
Threads presentation
 
OSINT Tool - Reconnaissance with Recon-ng
OSINT Tool - Reconnaissance with Recon-ngOSINT Tool - Reconnaissance with Recon-ng
OSINT Tool - Reconnaissance with Recon-ng
 
Core Java Programming Language (JSE) : Chapter I - Getting Started
Core Java Programming Language (JSE) : Chapter I - Getting StartedCore Java Programming Language (JSE) : Chapter I - Getting Started
Core Java Programming Language (JSE) : Chapter I - Getting Started
 
SUnit 4.0
SUnit 4.0SUnit 4.0
SUnit 4.0
 
Blog ingles pdf.1
Blog ingles pdf.1Blog ingles pdf.1
Blog ingles pdf.1
 
Swift for tensorflow
Swift for tensorflowSwift for tensorflow
Swift for tensorflow
 
Java Basics
Java BasicsJava Basics
Java Basics
 

Destacado (6)

Introduction to Java Programming Language
Introduction to Java Programming LanguageIntroduction to Java Programming Language
Introduction to Java Programming Language
 
Java basic
Java basicJava basic
Java basic
 
Introduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicoxIntroduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicox
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Learn Java language fundamentals with Unit nexus
Learn Java language fundamentals with Unit nexusLearn Java language fundamentals with Unit nexus
Learn Java language fundamentals with Unit nexus
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 

Similar a Java language: a gentle introduction

212 kuliah 01 pengenalan pemrograman berorientasi objek (java)
212 kuliah 01   pengenalan pemrograman berorientasi objek (java)212 kuliah 01   pengenalan pemrograman berorientasi objek (java)
212 kuliah 01 pengenalan pemrograman berorientasi objek (java)
yuan99
 
TechSearchWeb.pdf
TechSearchWeb.pdfTechSearchWeb.pdf
TechSearchWeb.pdf
TechSearchWeb
 
Technology Tutorial.pdf
Technology Tutorial.pdfTechnology Tutorial.pdf
Technology Tutorial.pdf
TechSearchWeb
 

Similar a Java language: a gentle introduction (20)

CORE JAVA
CORE JAVACORE JAVA
CORE JAVA
 
Introduction to java technology
Introduction to java technologyIntroduction to java technology
Introduction to java technology
 
Dr. Rajeshree Khande :Intoduction to java
Dr. Rajeshree Khande :Intoduction to javaDr. Rajeshree Khande :Intoduction to java
Dr. Rajeshree Khande :Intoduction to java
 
Intoduction to java
Intoduction to javaIntoduction to java
Intoduction to java
 
JAVA for Every one
JAVA for Every oneJAVA for Every one
JAVA for Every one
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java Slides
 
JAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptxJAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptx
 
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...
 
OOP with Java
OOP with JavaOOP with Java
OOP with Java
 
1.introduction to java
1.introduction to java1.introduction to java
1.introduction to java
 
Java ms harsha
Java ms harshaJava ms harsha
Java ms harsha
 
Introduction to java programming tutorial
Introduction to java programming   tutorialIntroduction to java programming   tutorial
Introduction to java programming tutorial
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programming
 
212 kuliah 01 pengenalan pemrograman berorientasi objek (java)
212 kuliah 01   pengenalan pemrograman berorientasi objek (java)212 kuliah 01   pengenalan pemrograman berorientasi objek (java)
212 kuliah 01 pengenalan pemrograman berorientasi objek (java)
 
Java@intro to java
Java@intro to javaJava@intro to java
Java@intro to java
 
1 .java basic
1 .java basic1 .java basic
1 .java basic
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programming
 
TechSearchWeb Tutorials.pdf
TechSearchWeb Tutorials.pdfTechSearchWeb Tutorials.pdf
TechSearchWeb Tutorials.pdf
 
TechSearchWeb.pdf
TechSearchWeb.pdfTechSearchWeb.pdf
TechSearchWeb.pdf
 
Technology Tutorial.pdf
Technology Tutorial.pdfTechnology Tutorial.pdf
Technology Tutorial.pdf
 

Último

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 

Último (20)

Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 

Java language: a gentle introduction

  • 1. JAVA LANGUAGE: a gentle introduction fabio.ferraguto@gmail.com
  • 2.  I n t r o du c t i o n  G e t t i ng S t a r t e d Object Oriented
  • 3. P a rt 1 In t rod u c ti o n
  • 4.
  • 6. January 23 1996 version 1.0 http://www.java.com/en/javahistory
  • 7. INTRODUCTION to JAVA UNIVERSE
  • 8. Wh a t’ s J A V A ?
  • 12.
  • 13. F ea tu r e s
  • 24. Rich
  • 27. JD K Java AP I JR E JV M
  • 28. JRE JDK (Java Runtime environment) (Java Development Toolkit) It is an implementation of the Java It is a bundle of software that you can Virtual Machine* which actually use to develop Java based executes Java programs. applications. Java Run Time Environment is a plug- Java Development Kit is needed for in needed for running java programs. developing java applications. JRE is smaller than JDK so it needs JDK needs more Disk space as it less Disk space. contains JRE along with various development tools. JRE can be downloaded/supported JDK can be downloaded/supported freely from freely from java.com java.sun.com It includes JVM , Core libraries and It includes JRE, set of API classes, other additional components to run Java compiler, Webstart and applications and applets written in additional files needed to write Java Java. applets and applications.
  • 29. “An imaginary machine that is Virtual Machine implemented by emulating it in software on a real machine. Code for the java virtual machine is stored in .class files, each on which contains code for at most one public class.” da “The Java Virtual Machine Specification”
  • 30. Pa rt 2 G e t ti n g S t a r te d
  • 31. My first Java program 1. public class Hello { 2. // entry point 3. public static void main(String[] args){ 4. System.out.println("Hello World!"); 5. } 6. }
  • 32. My first Java program Step 1: Open a text editor Step 2: Open a console (prompt dos/unix) Step 3: Write the code in text editor Step 4: Save as Hello.java
  • 33. My first Java program Step 5: Compile javac Hello.java
  • 34. My first Java program Step 6: Execute java Hello
  • 35. My first Java program 1. public class Hello { 2. // entry point 3. public static void main(String[] args){ 4. System.out.println("Hello World!"); 5. } 6. }
  • 36. My first Java program 1. public class Hello { 2. // entry point 3. public static void main(String[] args){ 4. System.out.println("Hello World!"); 5. } 6. }
  • 37. My first Java program 1. public class Hello { 2. // entry point 3. public static void main(String[] args){ 4. System.out.println("Hello World!"); 5. } 6. }
  • 38. My first Java program 1. public class Hello { 2. // entry point 3. public static void main(String[] args){ 4. System.out.println("Hello World!"); 5. } 6. }
  • 39. Pa rt 3 Object Oriented
  • 40. Par o gr a m m i n g P ar a d i gm s
  • 43. EXAMPLE: ORANGE SQUEEZER Rube Goldberg, Inventions of Professor Lucifer Butts, 1932
  • 44. “… nel progettare una sequenza codificata, quello che bisogna avere innanzitutto in mente non è l’apparenza originale della sequenza, ma piuttosto il suo funzionamento e il suo continuo cambiamento mentre il processo che essa controlla procede nel suo corso. … È dunque consigliabile incominciare la progettazione dalla fine, e cioè progettare per prima cosa il corso del processo e la relazione delle sue fasi successive con il codice che cambia, e quindi estrarre la sequenza codificata come operazione successiva.” Goldstine & Von Neumann, 1947
  • 45. “… Questi “linguaggi di Von-Neumann” creano dei blocchi stradali mentali enormi e non necessari nel pensare i programmi e nel creare le combinazioni di alto livello richieste da una metodologia di programmazione veramente potente. …” John Backus, 1978
  • 48. O b j e c ts ?
  • 49. Class
  • 52. C on c e pt s A nd F ea tu r e s
  • 56. Information Hiding
  • 62. Reuse