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
76
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
Building GoReleaser - from shell script to paid product
caarlos0
0
4.1k
Serving TUIs over SSH with Go
caarlos0
0
2k
construindo uma carreira com opensource
caarlos0
0
480
Introdução ao GoReleaser
caarlos0
0
1.2k
Intro to GoReleaser
caarlos0
0
1.2k
Intro to GoReleaser
caarlos0
0
1.6k
Gerenciando Projetos OpenSource
caarlos0
0
1.6k
GoReleaser: Lessons Learned (hacktoberfest)
caarlos0
0
2k
GoReleaser: Lessons Learned
caarlos0
0
2.8k
Other Decks in Programming
See All in Programming
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
190
AI巻き込み型コードレビューのススメ
nealle
2
2.5k
Head of Engineeringが現場で回した生産性向上施策 2025→2026
gessy0129
0
200
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.2k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
120
Python’s True Superpower
hynek
0
190
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
360
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
270
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
210
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
140
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
330
浮動小数の比較について
kishikawakatsumi
0
360
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
110
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
The agentic SEO stack - context over prompts
schlessera
0
680
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
170
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
560
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
BBQ
matthewcrist
89
10k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
250
Statistics for Hackers
jakevdp
799
230k
WENDY [Excerpt]
tessaabrams
9
36k
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