Java language: a gentle introduction

773 views
709 views

Published on

Published in: Technology, Education
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
773
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Java language: a gentle introduction

  1. 1. JAVA LANGUAGE:a gentle introductionfabio.ferraguto@gmail.com
  2. 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. 3. P a rt 1In t rod u c ti o n
  4. 4. 1991 OAK
  5. 5. January 23 1996 version 1.0http://www.java.com/en/javahistory
  6. 6. INTRODUCTION toJAVA UNIVERSE
  7. 7. Wh a t’ s J A V A ?
  8. 8. Language
  9. 9. RuntimeEnvironment
  10. 10. Standard Tools
  11. 11. F ea tu r e s
  12. 12. Simple
  13. 13. Object Oriented
  14. 14. Interpreted
  15. 15. ArchitectureNeutral
  16. 16. Portable
  17. 17. Robust
  18. 18. Distributed
  19. 19. Secure
  20. 20. Dynamic
  21. 21. Concurrent
  22. 22. Rich
  23. 23. GarbageCollector
  24. 24. JavaDevelopmentKit
  25. 25. JD K Java AP IJR E JV M
  26. 26. JRE JDK (Java Runtime environment) (Java Development Toolkit)It is an implementation of the Java It is a bundle of software that you canVirtual Machine* which actually use to develop Java basedexecutes Java programs. applications.Java Run Time Environment is a plug- Java Development Kit is needed forin needed for running java programs. developing java applications.JRE is smaller than JDK so it needs JDK needs more Disk space as itless Disk space. contains JRE along with various development tools.JRE can be downloaded/supported JDK can be downloaded/supportedfreely from freely fromjava.com java.sun.comIt includes JVM , Core libraries and It includes JRE, set of API classes,other additional components to run Java compiler, Webstart andapplications and applets written in additional files needed to write JavaJava. applets and applications.
  27. 27. “An imaginary machine that is Virtual Machineimplemented by emulating it insoftware on a real machine.Code for the java virtual machineis stored in .class files, each onwhich contains code for at mostone public class.” da “The Java Virtual Machine Specification”
  28. 28. Pa rt 2G e t ti n g S t a r te d
  29. 29. My first Java program1. public class Hello {2. // entry point3. public static void main(String[] args){4. System.out.println("Hello World!");5. }6. }
  30. 30. My first Java programStep 1: Open a text editorStep 2: Open a console (prompt dos/unix)Step 3: Write the code in text editorStep 4: Save as Hello.java
  31. 31. My first Java programStep 5: Compile javac Hello.java
  32. 32. My first Java programStep 6: Execute java Hello
  33. 33. My first Java program1. public class Hello {2. // entry point3. public static void main(String[] args){4. System.out.println("Hello World!");5. }6. }
  34. 34. My first Java program1. public class Hello {2. // entry point3. public static void main(String[] args){4. System.out.println("Hello World!");5. }6. }
  35. 35. My first Java program1. public class Hello {2. // entry point3. public static void main(String[] args){4. System.out.println("Hello World!");5. }6. }
  36. 36. My first Java program1. public class Hello {2. // entry point3. public static void main(String[] args){4. System.out.println("Hello World!");5. }6. }
  37. 37. Pa rt 3Object Oriented
  38. 38. Par o gr a m m i n g P ar a d i gm s
  39. 39. Processes
  40. 40. Machine
  41. 41. EXAMPLE: ORANGE SQUEEZERRube Goldberg, Inventions of Professor Lucifer Butts, 1932
  42. 42. “… nel progettare una sequenza codificata, quello che bisogna avere innanzitutto in mente non è l’apparenza originale della sequenza, ma piuttosto il suofunzionamento e il suo continuo cambiamento mentre ilprocesso che essa controlla procede nel suo corso. … È dunque consigliabile incominciare la progettazionedalla fine, e cioè progettare per prima cosa il corso delprocesso 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
  43. 43. “… 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
  44. 44. Things
  45. 45. Object Oriented
  46. 46. O b j e c ts ?
  47. 47. Class
  48. 48. Objects
  49. 49. Interface
  50. 50. C on c e pt s A nd F ea tu r e s
  51. 51. Classification
  52. 52. Activation
  53. 53. Encapsulation
  54. 54. Information Hiding
  55. 55. Inheritance
  56. 56. Composition
  57. 57. Polymorphism
  58. 58. Taxonomies
  59. 59. MultipleInheritance
  60. 60. Reuse

×