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

Docker for developers
Docker for developersDocker for developers
Docker for developerssparkfabrik
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!Umar Yusuf
 
OSINT Tool - Reconnaissance with Recon-ng
OSINT Tool - Reconnaissance with Recon-ngOSINT Tool - Reconnaissance with Recon-ng
OSINT Tool - Reconnaissance with Recon-ngRaghav Bisht
 
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 StartedWebStackAcademy
 
SUnit 4.0
SUnit 4.0SUnit 4.0
SUnit 4.0ESUG
 
Blog ingles pdf.1
Blog ingles pdf.1Blog ingles pdf.1
Blog ingles pdf.1negroronny
 

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

Introduction to Java Programming Language
Introduction to Java Programming LanguageIntroduction to Java Programming Language
Introduction to Java Programming Languagejaimefrozr
 
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 @drpicoxDavid Rodenas
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 
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 nexusUnit Nexus Pvt. Ltd.
 

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

Intoduction to java
Intoduction to javaIntoduction to java
Intoduction to javajalinder123
 
Dr. Rajeshree Khande :Intoduction to java
Dr. Rajeshree Khande :Intoduction to javaDr. Rajeshree Khande :Intoduction to java
Dr. Rajeshree Khande :Intoduction to javaDrRajeshreeKhande
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java SlidesVinit Vyas
 
JAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptxJAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptxDrPreethiD1
 
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
 
OOP with Java
OOP with JavaOOP with Java
OOP with JavaOmegaHub
 
Introduction to java programming tutorial
Introduction to java programming   tutorialIntroduction to java programming   tutorial
Introduction to java programming tutorialjackschitze
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programmingElizabeth Thomas
 
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
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programmingbusiness Corporate
 
TechSearchWeb Tutorials.pdf
TechSearchWeb Tutorials.pdfTechSearchWeb Tutorials.pdf
TechSearchWeb Tutorials.pdfTechSearchWeb
 
Technology Tutorial.pdf
Technology Tutorial.pdfTechnology Tutorial.pdf
Technology Tutorial.pdfTechSearchWeb
 

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
 
Intoduction to java
Intoduction to javaIntoduction to java
Intoduction to java
 
Dr. Rajeshree Khande :Intoduction to java
Dr. Rajeshree Khande :Intoduction to javaDr. Rajeshree Khande :Intoduction to java
Dr. Rajeshree Khande :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

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 

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