O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Java Is Back, Novidade do Java 8

2.289 visualizações

Publicada em

Apresentação utilizada na palestra Java Is Back, Novidades do Java8. Durante evento realizado pelo SouJava.

Publicada em: Tecnologia
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui

Java Is Back, Novidade do Java 8

  1. 1. Lançamento  do  Java  8  –  Java  Is  Back   Eder  Magalhães   @edermag   Novidades  do  Java  8  
  2. 2. Agenda   ü  Expecta;va;   ü  Interfaces  Funcionais,  sta;c  e  default;   ü  Stream  API;   ü  Lambda  Expressions;   ü  Method  reference;   ü  Date  Time  API;   ü  Algumas  mudanças  em  Collec;ons;   ü  Outras  novidades  e  melhorias;  
  3. 3. Expecta;va  do  Java  8   ü  Linguagem  mais  poderosa:   ü  O;mizações  na  VM;   ü  Melhorias  em  processamento  paralelo;   ü  Programação  mais  diver;da:   ü  Escreva  menos  e  faça  mais;   ü  APIs  modernas  e  eficientes;    
  4. 4. Interfaces  Funcionais   ü  Layout  padrão  para  interfaces  “enxutas”;   ü  Interfaces  que  definem  apenas  um  método  abstrado;   ü  @FunctionalInterface é  opcional  (like  @Override);   ü  São  essenciais  para  o  uso  de  Expressões  Lambda;  
  5. 5. Interfaces  Funcionais  Java   ü  Interfaces  do  legado  Java,  são  Funcionais:   ü  Runnable   ü  Comparable   ü  FileFilter   ü  PathMatcher  
  6. 6. Método  default  em  Interfaces   ü  Possibilidade  de  definir  o  código  de  um  método,  em  um   contrato;   public interface CriterioPontualidade { ... default boolean isPontual() { return getPrevisao.isBefore(getRealizacao()); } }
  7. 7. Método  default  em  Interfaces   ü  Principal  mo;vação:  compa;bilidade  com  o  legado;   ü  O  método  pode  ser  sobreescrito,  sempre  prevalesce  a   versão  do  objeto  (implementador);   ü  Compilador  não  aceita  conflitos;   ü  Não  faz  sen;do  criar  métodos  default  p/  métodos  de   Object  (equals  /  hashcode  /  toString).  Compilador  não   aceita;  
  8. 8. Método  sta;c  em  Interfaces   ü  Viabilizar  a  definição  de  métodos  u;litários  no  próprio   contrato;   public interface CriterioPontualidade { ... static Comparator<CriterioPontualidade> sortByPrevisao() { return new Comparator<CriterioPontualidade> () { ... }; } }
  9. 9. Pacote  java.util.function ü  JDK  8  disponibiliza  uma  série  de  novas  interfaces  funcionais;   ü  Function:  recebe  um  argumento  e  retorna  um  objeto;   ü  Consumer:  recebe  um  argumento,  sem  retorno  (void);   ü  Supply:  não  recebe  argumento  e  retorna  uma  objeto;     ü  Predicate:  recebe  um  argumento  e  retorna  um  boolean;   ü  BinaryOperator:  recebe  dois  argumentos  e  retorna  um;   ü  Especializações  para  primi;vos,  ex:  ToIntFunction;  
  10. 10. Stream  API   ü  Nova  API  para  manipulação  de  fluxo  de  dados;   ü  API  con;da  no  pacote  java.util.stream;   ü  As  Coleções  do  Java  foram  adaptadas  para  o  uso  de  Stream;   ü  Em  Coleções  atuam  de  forma  similar  a  um  Iterator;  
  11. 11. Destaque  de  Stream   ü  forEach:  processa  cada  elemento  con;do  no  Stream;   ü  map:  permite  realizar  transformações  em  dados  do  stream;   ü  filter:  uso  de  critérios  p/  avaliar  cada  elemento  do   stream;   ü  distinct:  avalia  cada  elemento  do  stream  para  desconsiderar   duplicidades;   ü  collect:  capturar  todos  os  elementos  con;dos  em  um  stream;   ü  count, max, sum  e  vários  outros  …  
  12. 12. Detalhes  sobre  Stream   ü  Intermediate:   ü  O  Stream  con;nua  aberto,  normalmente  retornam  um  novo   Stream.  Ex:  filter;   ü  Terminate:   ü  O  Stream  é  concluído.  Ex:  count;   ü  Podem  ser  processados  paralelamente;  
  13. 13. Lambda   ü  A  grande  novidade  do  Java  8;   ü  O  Java  mais  funcional,  incorporando  DSLs;   ü  Uma  forma  expressiva  de  criar  funções  anônimas  (Interfaces   Funcionais);   ü  Maior  impacto  para  os  programadores;  
  14. 14. Tarefa  simples:  ordenar  um  array   String[] nomes = {"Pedro", "Carolina", "Ana", "Bruno"};
  15. 15. Tarefa  simples:  ordenar  um  array   String[] nomes = {"Pedro", "Carolina", "Ana", "Bruno"}; Arrays.sort(nomes, new Comparator<String>() { public int compare(String s1, String s2) { return s1.compareToIgnoreCase(s2); } } );
  16. 16. Tarefa  simples:  ordenar  um  array   String[] nomes = {"Pedro", "Carolina", "Ana", "Bruno"}; Arrays.sort(nomes, new Comparator<String>() { public int compare(String s1, String s2) { return s1.compareToIgnoreCase(s2); } } );
  17. 17. Tarefa  simples:  ordenar  um  array   String[] nomes = {"Pedro", "Carolina", "Ana", "Bruno"}; Arrays.sort(nomes, (String s1, String s2) -> s1.compareToIgnoreCase(s2) ); Lambda  Expression  
  18. 18. Tarefa  simples:  ordenar  um  array   String[] nomes = {"Pedro", "Carolina", "Ana", "Bruno"}; Arrays.sort(nomes, (s1, s2) -> s1.compareToIgnoreCase(s2) ); Outra  opção  
  19. 19. Lambda,  a  mo;vação   ü  Programação  direta,  mais  obje;va;   ü  Eliminar  verbosidade  (código  ver;cal);   ü  Melhor  processamento  em  ambientes  mul;-­‐core;  
  20. 20. Sintaxe  de  expressões  Lambda   (int x, int y) -> x + y Argument  List   Body  Arrow  Token  
  21. 21. Method  reference   ü  Uma  forma  mais  compacta  de  escrever  expressões  Lambda;   ü  Lambda  definida  via  nome  de  um  método;   String[] nomes = {"Pedro", "Carolina", "Ana", "Bruno"}; Arrays.sort(nomes, String::compareToIgnoreCase );
  22. 22. Com  Lambda  não  é  possível  fazer:   ü  Acessar  variáveis  non-­‐final;   ü  Transparência  no  lançamento  de  excep;ons;   ü  Controle  de  fluxo,  no  forEach  não  é  possível  encerrar  o   loop;  
  23. 23. Date  Time  API   ü  Nova  API  para  manipulação  de  datas;   ü  Mais  clara,  organizada  e  eficiente;   ü  Define  estruturas  para:   ü  Data  e  Horario;   ü  Data;   ü  Horario;   ü  Períodos  e  instantes;   ü  Baseada  na  API  Joda  Time;  
  24. 24. Melhorias  na  API  de  coleções   ü  Iterable.forEach(Consumer);   ü  Collec;on.removeIf(Predicate);   ü  Collec;on.stream();   ü  Collec;on.parallelStream();   ü  Map.forEach(BiConsumer);   ü  Map.getOrDefault(Object,  V);  
  25. 25. Outras  melhorias   ü  String.join;   ü  Novos  componentes  em  Concurrency  API;   ü  Novos  componentes  em  IO/NIO  API;   ü  Mudanças  em  Reflec;on;   ü  Objetos  opcionais:  Optional, OptionalInt, OptionalDouble, OptionalLong;   ü  Classe  Base64;   ü  Novos  métodos  em  Math, Wrappers, ThreadLocal …  
  26. 26. Demos   ü  As  demos  dessa  palestra  foram  compar;lhadas  na  url:      hips://github.com/edermag/java8-­‐is-­‐back  
  27. 27. Links   ü  hip://www.techempower.com/blog/2013/03/26/everything-­‐ about-­‐java-­‐8/   ü  hip://openjdk.java.net/projects/lambda/   ü  hip://docs.oracle.com/javase/tutorial/java/javaOO/ lambdaexpressions.html   ü  hip://download.java.net/jdk8/docs/api/  
  28. 28. Obrigado!   ü  eder@yaw.com.br   ü  hips://twiier.com/edermag   ü  hip://github.com/edermag   ü  hip://edermag.blogspot.com.br/   ü  hips://bitbucket.org/edermag/  

×