SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
#0




                        Day #0
     Diving into Java : The Head First Way
                      Overview

                    Wildan Maulana
             wildan.m@openthinklabs.com
            http://training.openthinklabs.com/
Day 1
    Breaking the Surface: a quick dip
●   The way Java works
●   Code structure in Java
●   Anatomy of a class
●   The main() method
●   Looping
●   Conditional branching (if tests)
●   Coding the “99 bottles of beer” app
●   Phrase-o-matic
●   Fireside chat: compiler vs. JVM
●   Exercises and puzzles
Day 2
A Trip to Objectville: yes, there will be objects
  ●   Chair Wars (Brad the OO guy vs. Larry the
      procedural guy)
  ●   Inheritance (an introduction)
  ●   Overriding methods (an introduction)
  ●   What’s in a class? (methods, instance variables)
  ●   Making your first object
  ●   Using main()
  ●   Guessing Game code
  ●   Exercises and puzzles
Day 3
Know Your Variables: primitives and references
   ●   Declaring a variable (Java cares about type)
   ●   Primitive types (“I’d like a double with extra foam,
       please”)
   ●   Java keywords
   ●   Reference variables (remote control to an object)
   ●   Object declaration and assignment
   ●   Objects on the garbage-collectible heap
   ●   Arrays (a first look)
   ●   Exercises and puzzles
Day 4
How Objects Behave: object state affects method behavior

●   Methods use object state (bark different)
●   Method arguments and return types
●   Pass-by-value (the variable is always copied)
●   Getters and Setters
●   Encapsulation (do it or risk humiliation)
●   Using references in an array
●   Exercises and puzzles
Day 5
Extra-Strength Methods: flow control, operations, and more
       ●   Building the Sink a Dot Com game
       ●   Starting with the Simple Dot Com game (a simpler version)
       ●   Writing prepcode (pseudocode for the game)
       ●   Test code for Simple Dot Com
       ●   Coding the Simple Dot Com game
       ●   Final code for Simple Dot Com
       ●   Generating random numbers with Math.random()
       ●   Ready-bake code for getting user input from the command-line
       ●   Looping with for loops
       ●   Casting primitives from a large size to a smaller size
       ●   Converting a String to an int with Integer.parseInt()
       ●   Exercises and puzzles
Day 6
Using the Java Library: so you don’t have to write it all yourself

      ●   Analying the bug in the Simple Dot Com Game
      ●   ArrayList (taking advantage of the Java API)
      ●   Fixing the DotCom class code
      ●   Building the real game (Sink a Dot Com)
      ●   Prepcode for the real game
      ●   Code for the real game
      ●   boolean expressions
      ●   Using the library (Java API)
      ●   Using packages (import statements, fully-qualifi ed names)
      ●   Using the HTML API docs and reference books
      ●   Exercises and puzzles
Day 7
Better Living in Objectville: planning for the future
●   Understanding inheritance (superclass and subclass relationships)
●   Designing an inheritance tree (the Animal simulation)
●   Avoiding duplicate code (using inheritance)
●   Overriding methods
●   IS-A and HAS-A (bathtub girl)
●   What do you inherit from your superclass?
●   What does inheritance really buy you?
●   Polymorphism (using a supertype reference to a subclass object)
●   Rules for overriding (don’t touch those arguments and return types!)
●   Method overloading (nothing more than method name re-use)
●   Exercises and puzzles
Day 8
Serious Polymorphism: exploiting abstract classes and
                    interfaces
     ●   Some classes just should not be instantiated
     ●   Abstract classes (can’t be instantiated)
     ●   Abstract methods (must be implemented)
     ●   Polymorphism in action
     ●   Class Object (the ultimate superclass of everything)
     ●   Taking objects out of an ArrayList (they come out as type Object)
     ●   Compiler checks the reference type (before letting you call a method)
     ●   Get in touch with your inner object
     ●   Polymorphic references
     ●   Casting an object reference (moving lower on the inheritance tree)
     ●   Deadly Diamond of Death (multiple inheritance problem)
     ●   Using interfaces (the best solution!)
     ●   Exercises and puzzles
Day 9
Life and Death of an Object : Objects are born and
                    objects die
●   The stack and the heap, where objects and variables live
●   Methods on the stack
●   Where local variables live
●   Where instance variables live
●   The miracle of object creation
●   Constructors (the code that runs when you say new)
●   Initializing the state of a new Duck
●   Overloaded constructors
●   Superclass constructors (constructor chaining)
●   Invoking overloaded constructors using this()
●   Life of an object
●   Garbage Collection (and making objects eligible)
●   Exercises and puzzles
Day 10
Numbers Matter: math, formatting, wrappers, and statics
     ●   Math class (do you really need an instance of it?)
     ●   static methods
     ●   static variables
     ●   Constants (static final variables)
     ●   Math methods (random(), round(), abs(), etc)
     ●   Wrapper classes (Integer, Boolean, Character, etc.)
     ●   Autoboxing
     ●   Number formatting
     ●   Date formatting and manipulation
     ●   Static imports
     ●   Exercises and puzzles
Day 11
Risky Behavior: exception handling
●   Making a music machine (the BeatBox)
●   What if you need to call risky code?
●   Exceptions say “something bad may have happened...
●   The compiler guarantees (it checks) that you’re aware of the risks
●   Catching exceptions using a try/catch (skateboarder)
●   Flow control in try/catch blocks
●   The fi nally block (no matter what happens, turn off the oven!)
●   Catching multiple exceptions (the order matters)
●   Declaring an exception (just duck it)
●   Handle or declare law
●   Code Kitchen (making sounds)
●   Exercises and puzzles
Day 12
A Very Graphic Story: intro to GUI, event
      handling, and inner classes
●   Your first GUI
●   Getting a user event
●   Implement a listener interface
●   Getting a button’s ActionEvent
●   Putting graphics on a GUI
●   Fun with paintComponent()
●   The Graphics2D object
●   Putting more than one button on a screen
●   Inner classes to the rescue (make your listener an inner class)
●   Animation (move it, paint it, move it, paint it, move it, paint it...)
●   Code Kitchen (painting graphics with the beat of the music)
●   Exercises and puzzles
Day 13
Work on Your Swing: layout managers and components
    ●   Swing Component
    ●   Layout Managers (they control size and placement
    ●   Three Layout Managers (border, flow, box)
    ●   BorderLayout (cares about five regions)
    ●   FlowLayout (cares about the order and preferred size
    ●   BoxLayout (like flow, but can stack components vertically)
    ●   JTextField (for single-line user input)
    ●   JTextArea (for multi-line, scrolling text)
    ●   JCheckBox (is it selected?)
    ●   JList (a scrollable, selectable list
    ●   Code Kitchen (The Big One - building the BeatBox chat client)
    ●   Exercises and puzzles
Day 14
Saving Objects: serialization and I/O
 ●   Saving object state
 ●   Writing a serialized object to a file
 ●   Java input and output streams (connections and chains)
 ●   Object serialization
 ●   Implementing the Serializable interface
 ●   Using transient variables
 ●   Deserializing an object
 ●   Writing to a text file
 ●   java.io.File
 ●   Reading from a text file
 ●   Splitting a String into tokens with split()
 ●   CodeKitchen
 ●   Exercises and puzzles
Day 15
Make a Connection: networking sockets and multithreading
  ●   Chat program overview                ●   Launching a new thread (make it, start it)
                                               The Runnable interface (the thread’s job
      Connecting, sending, and receiving
                                           ●
  ●
                                           ●   Three states of a new Thread object (new, runnable,
  ●   Network sockets                          running)
                                               The runnable-running loop
      TCP ports
                                           ●
  ●
                                           ●   Thread scheduler (it’s his decision, not yours)
  ●   Reading data from a socket (using    ●   Putting a thread to sleep
      BufferedReader)                      ●   Making and starting two threads
  ●   Writing data to a socket (using      ●   Concurrency issues: can this couple be saved?
      PrintWriter)                         ●   The Ryan and Monica concurrency problem, in code
                                               Locking to make things atomc
  ●   Writing the Daily Advice Client      ●


                                               Every object has a lock
      program                              ●


                                           ●   The dreaded “Lost Update” problem
  ●   Writing a simple server              ●   Synchronized methods (using a lock
  ●   Daily Advice Server code             ●   Deadlock!
                                               Multithreaded ChatClient code
  ●   Writing a chat client                ●


                                           ●   Ready-bake SimpleChatServer
  ●   Multiple call stacks                 ●   Exercises and puzzles
Day 16
Data Structures: collections and generics
 ●   Collections
 ●   Sorting an ArrayList with Collections.sort()
 ●   Generics and type-safety
 ●   Sorting things that implement the Comparable interface
 ●   Sorting things with a custom Comparator
 ●   The collection API—lists, sets, and maps
 ●   Avoiding duplicates with HashSet
 ●   Overriding hashCode() and equals()
 ●   HashMap
 ●   Using wildcards for polymorphism
 ●   Exercises and puzzles
Day 17
Release Your Code: packaging and deployment
     ●   Deployment options
     ●   Keep your source code and class fi les separat
     ●   Making an executable JAR (Java Archives)
     ●   Running an executable JAR
     ●   Put your classes in a package!
     ●   Packages must have a matching directory structure
     ●   Compiling and running with packages
     ●   Compiling with -d
     ●   Making an executable JAR (with packages)
     ●   Java Web Start (JWS) for deployment from the web
     ●   How to make and deploy a JWS application
     ●   Exercises and puzzles
Day 18
Distributed Computing: RMI with a dash of servlets, EJB,
                        and Jini
●   Java Remote Method Invocation (RMI), hands-
    on, very detailed
●   Servlets (a quick look)
●   Enterprise JavaBeans (EJB), a very quick look
●   Jini, the best trick of all
●   Building the really cool universal service
    browser
●   The End
Reference
●   Kathy Sierra & Bert Bates;
    Head First Java 2nd Edition, O'Reilly, 2002

Mais conteúdo relacionado

Semelhante a OpenThink Labs Training : Diving into Java, The Head First Way

IntoWebGL - Unite Melbourne 2015
IntoWebGL - Unite Melbourne 2015IntoWebGL - Unite Melbourne 2015
IntoWebGL - Unite Melbourne 2015Ryan Alcock
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java codeAttila Balazs
 
Working With Legacy Code
Working With Legacy CodeWorking With Legacy Code
Working With Legacy CodeAndrea Polci
 
JavaScript From Hell - CONFidence 2.0 2009
JavaScript From Hell - CONFidence 2.0 2009JavaScript From Hell - CONFidence 2.0 2009
JavaScript From Hell - CONFidence 2.0 2009Mario Heiderich
 
Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+Python Ireland
 
Utopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersUtopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersJaime Buelta
 
Mobycraft:Docker in 8-bit (Meetup at Docker HQ 4/7)
Mobycraft:Docker in 8-bit (Meetup at Docker HQ 4/7)Mobycraft:Docker in 8-bit (Meetup at Docker HQ 4/7)
Mobycraft:Docker in 8-bit (Meetup at Docker HQ 4/7)Docker, Inc.
 
Shiksharth com java_topics
Shiksharth com java_topicsShiksharth com java_topics
Shiksharth com java_topicsRajesh Verma
 
Simple Pure Java
Simple Pure JavaSimple Pure Java
Simple Pure JavaAnton Keks
 
Scala on-android
Scala on-androidScala on-android
Scala on-androidlifecoder
 
Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016maiktoepfer
 
Effective Scala: Programming Patterns
Effective Scala: Programming PatternsEffective Scala: Programming Patterns
Effective Scala: Programming PatternsVasil Remeniuk
 
Everything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is WrongEverything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is WrongTim Boudreau
 
Scala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusScala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusBoldRadius Solutions
 
Are app servers still fascinating
Are app servers still fascinatingAre app servers still fascinating
Are app servers still fascinatingAntonio Goncalves
 

Semelhante a OpenThink Labs Training : Diving into Java, The Head First Way (20)

IntoWebGL - Unite Melbourne 2015
IntoWebGL - Unite Melbourne 2015IntoWebGL - Unite Melbourne 2015
IntoWebGL - Unite Melbourne 2015
 
Cloud accounting software uk
Cloud accounting software ukCloud accounting software uk
Cloud accounting software uk
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java code
 
Transitioning to Native
Transitioning to NativeTransitioning to Native
Transitioning to Native
 
Working With Legacy Code
Working With Legacy CodeWorking With Legacy Code
Working With Legacy Code
 
JavaScript From Hell - CONFidence 2.0 2009
JavaScript From Hell - CONFidence 2.0 2009JavaScript From Hell - CONFidence 2.0 2009
JavaScript From Hell - CONFidence 2.0 2009
 
Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+
 
Utopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersUtopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K users
 
Core Java Tutorial
Core Java TutorialCore Java Tutorial
Core Java Tutorial
 
Spock pres
Spock presSpock pres
Spock pres
 
Mobycraft:Docker in 8-bit (Meetup at Docker HQ 4/7)
Mobycraft:Docker in 8-bit (Meetup at Docker HQ 4/7)Mobycraft:Docker in 8-bit (Meetup at Docker HQ 4/7)
Mobycraft:Docker in 8-bit (Meetup at Docker HQ 4/7)
 
Shiksharth com java_topics
Shiksharth com java_topicsShiksharth com java_topics
Shiksharth com java_topics
 
Simple Pure Java
Simple Pure JavaSimple Pure Java
Simple Pure Java
 
MongoDB Online Training.pdf
MongoDB Online Training.pdfMongoDB Online Training.pdf
MongoDB Online Training.pdf
 
Scala on-android
Scala on-androidScala on-android
Scala on-android
 
Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016
 
Effective Scala: Programming Patterns
Effective Scala: Programming PatternsEffective Scala: Programming Patterns
Effective Scala: Programming Patterns
 
Everything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is WrongEverything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is Wrong
 
Scala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusScala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadius
 
Are app servers still fascinating
Are app servers still fascinatingAre app servers still fascinating
Are app servers still fascinating
 

Mais de Wildan Maulana

Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018Wildan Maulana
 
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...Wildan Maulana
 
Ketahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam MelonKetahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam MelonWildan Maulana
 
Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014Wildan Maulana
 
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...Wildan Maulana
 
PostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyToolsPostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyToolsWildan Maulana
 
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...Wildan Maulana
 
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai SpMensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai SpWildan Maulana
 
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity ProviderKonfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity ProviderWildan Maulana
 
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)Wildan Maulana
 
Instalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphpInstalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphpWildan Maulana
 
River Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River RestorationRiver Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River RestorationWildan Maulana
 
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...
Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...Wildan Maulana
 
Penilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan DasarPenilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan DasarWildan Maulana
 
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and UsesProyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and UsesWildan Maulana
 
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang TuaOpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang TuaWildan Maulana
 
Menggunakan AlisJK : Equating
Menggunakan AlisJK : EquatingMenggunakan AlisJK : Equating
Menggunakan AlisJK : EquatingWildan Maulana
 
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)Wildan Maulana
 
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012Wildan Maulana
 

Mais de Wildan Maulana (20)

Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018
 
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
 
Ketahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam MelonKetahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam Melon
 
Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014
 
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
 
PostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyToolsPostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
 
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...
 
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai SpMensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
 
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity ProviderKonfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity Provider
 
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
 
Instalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphpInstalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphp
 
River Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River RestorationRiver Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River Restoration
 
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...
Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...
 
Penilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan DasarPenilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan Dasar
 
Statistik Listrik
Statistik ListrikStatistik Listrik
Statistik Listrik
 
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and UsesProyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
 
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang TuaOpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
 
Menggunakan AlisJK : Equating
Menggunakan AlisJK : EquatingMenggunakan AlisJK : Equating
Menggunakan AlisJK : Equating
 
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)
 
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012
 

Último

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
🐬 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
 
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
 
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 DevelopmentsTrustArc
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Último (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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...
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

OpenThink Labs Training : Diving into Java, The Head First Way

  • 1. #0 Day #0 Diving into Java : The Head First Way Overview Wildan Maulana wildan.m@openthinklabs.com http://training.openthinklabs.com/
  • 2. Day 1 Breaking the Surface: a quick dip ● The way Java works ● Code structure in Java ● Anatomy of a class ● The main() method ● Looping ● Conditional branching (if tests) ● Coding the “99 bottles of beer” app ● Phrase-o-matic ● Fireside chat: compiler vs. JVM ● Exercises and puzzles
  • 3. Day 2 A Trip to Objectville: yes, there will be objects ● Chair Wars (Brad the OO guy vs. Larry the procedural guy) ● Inheritance (an introduction) ● Overriding methods (an introduction) ● What’s in a class? (methods, instance variables) ● Making your first object ● Using main() ● Guessing Game code ● Exercises and puzzles
  • 4. Day 3 Know Your Variables: primitives and references ● Declaring a variable (Java cares about type) ● Primitive types (“I’d like a double with extra foam, please”) ● Java keywords ● Reference variables (remote control to an object) ● Object declaration and assignment ● Objects on the garbage-collectible heap ● Arrays (a first look) ● Exercises and puzzles
  • 5. Day 4 How Objects Behave: object state affects method behavior ● Methods use object state (bark different) ● Method arguments and return types ● Pass-by-value (the variable is always copied) ● Getters and Setters ● Encapsulation (do it or risk humiliation) ● Using references in an array ● Exercises and puzzles
  • 6. Day 5 Extra-Strength Methods: flow control, operations, and more ● Building the Sink a Dot Com game ● Starting with the Simple Dot Com game (a simpler version) ● Writing prepcode (pseudocode for the game) ● Test code for Simple Dot Com ● Coding the Simple Dot Com game ● Final code for Simple Dot Com ● Generating random numbers with Math.random() ● Ready-bake code for getting user input from the command-line ● Looping with for loops ● Casting primitives from a large size to a smaller size ● Converting a String to an int with Integer.parseInt() ● Exercises and puzzles
  • 7. Day 6 Using the Java Library: so you don’t have to write it all yourself ● Analying the bug in the Simple Dot Com Game ● ArrayList (taking advantage of the Java API) ● Fixing the DotCom class code ● Building the real game (Sink a Dot Com) ● Prepcode for the real game ● Code for the real game ● boolean expressions ● Using the library (Java API) ● Using packages (import statements, fully-qualifi ed names) ● Using the HTML API docs and reference books ● Exercises and puzzles
  • 8. Day 7 Better Living in Objectville: planning for the future ● Understanding inheritance (superclass and subclass relationships) ● Designing an inheritance tree (the Animal simulation) ● Avoiding duplicate code (using inheritance) ● Overriding methods ● IS-A and HAS-A (bathtub girl) ● What do you inherit from your superclass? ● What does inheritance really buy you? ● Polymorphism (using a supertype reference to a subclass object) ● Rules for overriding (don’t touch those arguments and return types!) ● Method overloading (nothing more than method name re-use) ● Exercises and puzzles
  • 9. Day 8 Serious Polymorphism: exploiting abstract classes and interfaces ● Some classes just should not be instantiated ● Abstract classes (can’t be instantiated) ● Abstract methods (must be implemented) ● Polymorphism in action ● Class Object (the ultimate superclass of everything) ● Taking objects out of an ArrayList (they come out as type Object) ● Compiler checks the reference type (before letting you call a method) ● Get in touch with your inner object ● Polymorphic references ● Casting an object reference (moving lower on the inheritance tree) ● Deadly Diamond of Death (multiple inheritance problem) ● Using interfaces (the best solution!) ● Exercises and puzzles
  • 10. Day 9 Life and Death of an Object : Objects are born and objects die ● The stack and the heap, where objects and variables live ● Methods on the stack ● Where local variables live ● Where instance variables live ● The miracle of object creation ● Constructors (the code that runs when you say new) ● Initializing the state of a new Duck ● Overloaded constructors ● Superclass constructors (constructor chaining) ● Invoking overloaded constructors using this() ● Life of an object ● Garbage Collection (and making objects eligible) ● Exercises and puzzles
  • 11. Day 10 Numbers Matter: math, formatting, wrappers, and statics ● Math class (do you really need an instance of it?) ● static methods ● static variables ● Constants (static final variables) ● Math methods (random(), round(), abs(), etc) ● Wrapper classes (Integer, Boolean, Character, etc.) ● Autoboxing ● Number formatting ● Date formatting and manipulation ● Static imports ● Exercises and puzzles
  • 12. Day 11 Risky Behavior: exception handling ● Making a music machine (the BeatBox) ● What if you need to call risky code? ● Exceptions say “something bad may have happened... ● The compiler guarantees (it checks) that you’re aware of the risks ● Catching exceptions using a try/catch (skateboarder) ● Flow control in try/catch blocks ● The fi nally block (no matter what happens, turn off the oven!) ● Catching multiple exceptions (the order matters) ● Declaring an exception (just duck it) ● Handle or declare law ● Code Kitchen (making sounds) ● Exercises and puzzles
  • 13. Day 12 A Very Graphic Story: intro to GUI, event handling, and inner classes ● Your first GUI ● Getting a user event ● Implement a listener interface ● Getting a button’s ActionEvent ● Putting graphics on a GUI ● Fun with paintComponent() ● The Graphics2D object ● Putting more than one button on a screen ● Inner classes to the rescue (make your listener an inner class) ● Animation (move it, paint it, move it, paint it, move it, paint it...) ● Code Kitchen (painting graphics with the beat of the music) ● Exercises and puzzles
  • 14. Day 13 Work on Your Swing: layout managers and components ● Swing Component ● Layout Managers (they control size and placement ● Three Layout Managers (border, flow, box) ● BorderLayout (cares about five regions) ● FlowLayout (cares about the order and preferred size ● BoxLayout (like flow, but can stack components vertically) ● JTextField (for single-line user input) ● JTextArea (for multi-line, scrolling text) ● JCheckBox (is it selected?) ● JList (a scrollable, selectable list ● Code Kitchen (The Big One - building the BeatBox chat client) ● Exercises and puzzles
  • 15. Day 14 Saving Objects: serialization and I/O ● Saving object state ● Writing a serialized object to a file ● Java input and output streams (connections and chains) ● Object serialization ● Implementing the Serializable interface ● Using transient variables ● Deserializing an object ● Writing to a text file ● java.io.File ● Reading from a text file ● Splitting a String into tokens with split() ● CodeKitchen ● Exercises and puzzles
  • 16. Day 15 Make a Connection: networking sockets and multithreading ● Chat program overview ● Launching a new thread (make it, start it) The Runnable interface (the thread’s job Connecting, sending, and receiving ● ● ● Three states of a new Thread object (new, runnable, ● Network sockets running) The runnable-running loop TCP ports ● ● ● Thread scheduler (it’s his decision, not yours) ● Reading data from a socket (using ● Putting a thread to sleep BufferedReader) ● Making and starting two threads ● Writing data to a socket (using ● Concurrency issues: can this couple be saved? PrintWriter) ● The Ryan and Monica concurrency problem, in code Locking to make things atomc ● Writing the Daily Advice Client ● Every object has a lock program ● ● The dreaded “Lost Update” problem ● Writing a simple server ● Synchronized methods (using a lock ● Daily Advice Server code ● Deadlock! Multithreaded ChatClient code ● Writing a chat client ● ● Ready-bake SimpleChatServer ● Multiple call stacks ● Exercises and puzzles
  • 17. Day 16 Data Structures: collections and generics ● Collections ● Sorting an ArrayList with Collections.sort() ● Generics and type-safety ● Sorting things that implement the Comparable interface ● Sorting things with a custom Comparator ● The collection API—lists, sets, and maps ● Avoiding duplicates with HashSet ● Overriding hashCode() and equals() ● HashMap ● Using wildcards for polymorphism ● Exercises and puzzles
  • 18. Day 17 Release Your Code: packaging and deployment ● Deployment options ● Keep your source code and class fi les separat ● Making an executable JAR (Java Archives) ● Running an executable JAR ● Put your classes in a package! ● Packages must have a matching directory structure ● Compiling and running with packages ● Compiling with -d ● Making an executable JAR (with packages) ● Java Web Start (JWS) for deployment from the web ● How to make and deploy a JWS application ● Exercises and puzzles
  • 19. Day 18 Distributed Computing: RMI with a dash of servlets, EJB, and Jini ● Java Remote Method Invocation (RMI), hands- on, very detailed ● Servlets (a quick look) ● Enterprise JavaBeans (EJB), a very quick look ● Jini, the best trick of all ● Building the really cool universal service browser ● The End
  • 20. Reference ● Kathy Sierra & Bert Bates; Head First Java 2nd Edition, O'Reilly, 2002