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
61
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
Serving TUIs over SSH with Go
caarlos0
0
730
construindo uma carreira com opensource
caarlos0
0
360
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.5k
Go 1.10 Release Party @ Joinville Go Meetup
caarlos0
0
2.1k
Other Decks in Programming
See All in Programming
iOSアプリで測る!名古屋駅までの 方向と距離
ryunakayama
0
160
知識0からカンファレンスやってみたらこうなった!
syossan27
5
280
UMAPをざっくりと理解 / Overview of UMAP
kaityo256
PRO
3
1.6k
The New Developer Workflow: How AI Transforms Ideas into Code
danielsogl
0
140
カウシェで Four Keys の改善を試みた理由
ike002jp
1
140
VitestのIn-Source Testingが便利
taro28
9
2.5k
Ruby で作る RISC-V CPU エミュレーター / RISC-V CPU emulator made with Ruby
hayaokimura
5
1.1k
医療系ソフトウェアのAI駆動開発
koukimiura
1
120
AWS Summit Hong Kong 2025: Reinventing Programming - How AI Transforms Our Enterprise Coding Approach
dwchiang
0
140
プロダクトエンジニアのしごと 〜 受託 × 高難度を乗り越えるOptium開発 〜
algoartis
0
230
Jakarta EE Meets AI
ivargrimstad
0
960
「理解」を重視したAI活用開発
fast_doctor
0
310
Featured
See All Featured
Music & Morning Musume
bryan
47
6.5k
Raft: Consensus for Rubyists
vanstee
137
6.9k
Adopting Sorbet at Scale
ufuk
76
9.4k
It's Worth the Effort
3n
184
28k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
13
850
Making the Leap to Tech Lead
cromwellryan
133
9.3k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Typedesign – Prime Four
hannesfritz
41
2.6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
The Cult of Friendly URLs
andyhume
78
6.4k
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