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
42
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
180
Introdução ao GoReleaser
caarlos0
0
970
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.7k
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
フロントエンドの現在地とこれから
koba04
10
4.5k
sqlcを利用してsqlに型付けを
kamiyam
0
240
Modern Functional Fluent CFML REST by Luis Majano
ortus24
0
140
Competitionsだけじゃない! Kaggle Notebooks Grandmasterのすすめ
corochann
2
400
(Deep|Web) Link support with expo-router
mrtry
0
180
게임 개발하던 학생이이 세계에선 안드로이드 개발자?
pangmoo
0
110
現場から考えるソフトウェアエンジニアリングの価値と実験
nomuson
1
130
ポケモンで考えるコミュニケーション / Communication Lessons from Pokémon
mackey0225
4
170
もう実家に手頃な情シス娘は不要!Bedrockでもう一人の娘を作る
komakichi
0
100
App Router 悲喜交々
quramy
7
380
[KR] Server Driven Compose With Firebase
skydoves
2
200
Real-time message handling and notifications with API Platform and Symfony
alli83
1
110
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
41
9.2k
Done Done
chrislema
181
16k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Designing Experiences People Love
moore
138
23k
Code Review Best Practice
trishagee
62
16k
The Power of CSS Pseudo Elements
geoffreycrofte
71
5.3k
GraphQLとの向き合い方2022年版
quramy
43
13k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
4
120
Pencils Down: Stop Designing & Start Developing
hursman
119
11k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
39
2.1k
4 Signs Your Business is Dying
shpigford
180
21k
Statistics for Hackers
jakevdp
796
220k
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