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
79
0
Share
As Velhas Novas do Java 7
Carlos Alexandro Becker
June 05, 2014
More Decks by Carlos Alexandro Becker
See All by Carlos Alexandro Becker
Building GoReleaser - from shell script to paid product
caarlos0
0
4.1k
Serving TUIs over SSH with Go
caarlos0
0
2.1k
construindo uma carreira com opensource
caarlos0
0
500
Introdução ao GoReleaser
caarlos0
0
1.3k
Intro to GoReleaser
caarlos0
0
1.3k
Intro to GoReleaser
caarlos0
0
1.7k
Gerenciando Projetos OpenSource
caarlos0
0
1.6k
GoReleaser: Lessons Learned (hacktoberfest)
caarlos0
0
2k
GoReleaser: Lessons Learned
caarlos0
0
2.9k
Other Decks in Programming
See All in Programming
Road to RubyKaigi: Play Hard(ware)
makicamel
1
550
ハーネスエンジニアリングとは?
kinopeee
13
6.8k
Making the RBS Parser Faster
soutaro
0
660
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
2
290
継続的な負荷検証を目指して
pyama86
0
280
20260514 - build with ai 2026 - build LINE Bot with Gemini CLI
line_developers_tw
PRO
0
230
「OSSがあるなら自作するな」は AI時代も正しいか ── Build vs Adopt の新しい判断基準
kumorn5s
4
1.3k
2026年のソフトウェア開発を考える(2026/05版) / Software Engineering Scrum Fest Niigata 2026 Edition
twada
PRO
21
11k
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
180
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
Claude CodeでETLジョブ実行テストを自動化してみた
yoshikikasama
0
1.1k
t *testing.T は どこからやってくるの?
otakakot
1
900
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
190
Fireside Chat
paigeccino
42
3.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Making the Leap to Tech Lead
cromwellryan
135
9.8k
KATA
mclloyd
PRO
35
15k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Context Engineering - Making Every Token Count
addyosmani
9
860
Paper Plane
katiecoart
PRO
1
49k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Practical Orchestrator
shlominoach
191
11k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.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