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
44
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
240
Introdução ao GoReleaser
caarlos0
0
980
Intro to GoReleaser
caarlos0
0
920
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.3k
Go 1.10 Release Party @ Joinville Go Meetup
caarlos0
0
1.9k
Monitoring @ ContaAzul
caarlos0
0
2.1k
Other Decks in Programming
See All in Programming
C++でシェーダを書く
fadis
6
4.1k
Macとオーディオ再生 2024/11/02
yusukeito
0
370
Jakarta EE meets AI
ivargrimstad
0
160
Jakarta EE meets AI
ivargrimstad
0
610
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
670
Contemporary Test Cases
maaretp
0
140
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Happy Clients
brianwarren
98
6.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
What's new in Ruby 2.0
geeforr
343
31k
Building Applications with DynamoDB
mza
90
6.1k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
How STYLIGHT went responsive
nonsquared
95
5.2k
Teambox: Starting and Learning
jrom
133
8.8k
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