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
59
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
350
Introdução ao GoReleaser
caarlos0
0
1.1k
Intro to GoReleaser
caarlos0
0
1.1k
Intro to GoReleaser
caarlos0
0
1.5k
Gerenciando Projetos OpenSource
caarlos0
0
1.5k
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
2.1k
Monitoring @ ContaAzul
caarlos0
0
2.2k
Other Decks in Programming
See All in Programming
Sharing features among Android applications: experience feedback
jbvincey
0
100
ミリしらMCP勉強会
watany
4
750
スモールスタートで始めるためのLambda×モノリス(Lambdalith)
akihisaikeda
2
260
Defying Front-End Inertia: Inertia.js on Rails
skryukov
0
470
Vibe Codingをせずに Clineを使っている
watany
17
6.2k
AIコードエディタの基盤となるLLMのFlutter性能評価
alquist4121
0
210
Code smarter, not harder - How AI Coding Tools Boost Your Productivity | Webinar 2025
danielsogl
0
120
Making TCPSocket.new "Happy"!
coe401_
1
490
Optimizing JRuby 10
headius
0
270
MCP調べてみました! / Exploring MCP
uhzz
2
2.3k
タイムゾーンの奥地は思ったよりも闇深いかもしれない
suguruooki
1
620
データベースエンジニアの仕事を楽にする。PgAssistantの紹介
nnaka2992
9
4.5k
Featured
See All Featured
Thoughts on Productivity
jonyablonski
69
4.6k
The Language of Interfaces
destraynor
157
24k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
135
33k
Statistics for Hackers
jakevdp
798
220k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
A Tale of Four Properties
chriscoyier
158
23k
RailsConf 2023
tenderlove
30
1.1k
Unsuck your backbone
ammeep
670
57k
Code Reviewing Like a Champion
maltzj
522
40k
Music & Morning Musume
bryan
47
6.5k
A designer walks into a library…
pauljervisheath
205
24k
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