SlideShare uma empresa 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

Mais conteúdo relacionado

Mais procurados

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

Mais procurados (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
 

Destaque (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
 

Semelhante 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
 

Semelhante 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

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+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...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
+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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

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