Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
As Velhas Novas do Java 7
Search
Carlos Alexandro Becker
June 05, 2014
Programming
0
53
As Velhas Novas do Java 7
Carlos Alexandro Becker
June 05, 2014
Tweet
Share
More Decks by Carlos Alexandro Becker
See All by Carlos Alexandro Becker
construindo uma carreira com opensource
caarlos0
0
310
Introdução ao GoReleaser
caarlos0
0
1k
Intro to GoReleaser
caarlos0
0
960
Intro to GoReleaser
caarlos0
0
1.3k
Gerenciando Projetos OpenSource
caarlos0
0
1.4k
GoReleaser: Lessons Learned (hacktoberfest)
caarlos0
0
1.8k
GoReleaser: Lessons Learned
caarlos0
0
2.4k
Go 1.10 Release Party @ Joinville Go Meetup
caarlos0
0
2k
Monitoring @ ContaAzul
caarlos0
0
2.2k
Other Decks in Programming
See All in Programming
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
10
1.4k
AWS Lambda functions with C# 用の Dev Container Template を作ってみた件
mappie_kochi
0
220
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
200
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
4.2k
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
990
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
1
3.3k
CNCF Project の作者が考えている OSS の運営
utam0k
5
620
最近のVS Codeで気になるニュース 2025/01
74th
1
240
functionalなアプローチで動的要素を排除する
ryopeko
1
920
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
2.4k
ErdMap: Thinking about a map for Rails applications
makicamel
1
1.1k
ゼロからの、レトロゲームエンジンの作り方
tokujiros
3
1.1k
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
19k
Docker and Python
trallard
43
3.2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
11
900
Art, The Web, and Tiny UX
lynnandtonic
298
20k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
520
Navigating Team Friction
lara
183
15k
Visualization
eitanlees
146
15k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
220
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Transcript
Java 7 as velhas novas do
Java 6: Dec 2006 Java 7: Jul 2011 Java 8:
Mar 2014 História
Lambdas, Jigsaw, e parte do Project Coin foram dropados do
Java 7
Agenda • Diamond Operator • Strings em Switch’s • Automatic
Resource Management • Numeric Literals com Underscores • Exception Handling (multi-catch) • NIO 2.0 • Fork and Join • invokedynamic
Diamond Operator // java 6 Map<String, List<String>> list6 =
new TreeMap<String, List<String>>(); // java 7 Map<String, List<String>> list7 = new TreeMap<>();
String em Switch’s // java 6 AnEnum a = AnEnum.A;
switch (a) { case A: doSomethingWhenA(); break; // … }
String em Switch’s // java 7 String b = "b";
switch(b) { case "b": doSomethingWhenB(); break; // … }
Automatic Resource Management // java 6 BlahResource resource; try {
resource = new BlahResource(); resource.doSomething(); } catch (Exception e) { log.error( “Maoeee”, e ); } finally { try { resource.close(); } catch (BlahResourceException e) { log.error( “Ah haee”, e ); } }
Automatic Resource Management // java 7 try (BlahResource resource =
new BlahResource()) { resource.doSomething(); } catch (Exception e) { log.error( “Maoeee”, e ); }
Numeric Literals // java 6 int thousand = 1000; //
java 7 int thousand = 1_000;
Exception Handling // java 6 try { oneThousandCheckedExceptionsLater(); } catch
(ExceptionOne e) { log.error(“Erro: ", e); } catch (ExceptionTwo e) { log.error(“Erro: ", e); } catch (ExceptionThree e) { log.error(“Erro: ", e); }
Exception Handling // java 7 try { oneThousandCheckedExceptionsLater(); } catch
(ExceptionOne | ExceptionTwo | ExceptionThree e) { log.error(“Erro:”, e); }
NIO 2.0 • Path & Paths • Files • FileSystems
• WatchService
Fork and Join • Dividir para conquistar • ForkJoinTask &
ForkJoinPool
incokedynamic • Recurso da JVM para suportar melhor linguagens com
tipagem dinâmica • java.lang.invoke
PROTIPS™
None
GRÁTIS NA LOJA KINDLE!
Bom e velho Javadoc ☕️
Dúvidas?
Thanks https://speakerdeck.com/caarlos0/as-velhas-novas-do-java-7