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
64
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
3.9k
Serving TUIs over SSH with Go
caarlos0
0
1.6k
construindo uma carreira com opensource
caarlos0
0
440
Introdução ao GoReleaser
caarlos0
0
1.1k
Intro to GoReleaser
caarlos0
0
1.1k
Intro to GoReleaser
caarlos0
0
1.6k
Gerenciando Projetos OpenSource
caarlos0
0
1.5k
GoReleaser: Lessons Learned (hacktoberfest)
caarlos0
0
1.9k
GoReleaser: Lessons Learned
caarlos0
0
2.6k
Other Decks in Programming
See All in Programming
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
190
XP, Testing and ninja testing ZOZ5
m_seki
3
600
詳しくない分野でのVibe Codingで困ったことと学び/vibe-coding-in-unfamiliar-area
shibayu36
3
4.8k
チームの境界をブチ抜いていけ
tokai235
0
160
理論と実務のギャップを超える
eycjur
0
120
私達はmodernize packageに夢を見るか feat. go/analysis, go/ast / Go Conference 2025
kaorumuta
2
520
そのpreloadは必要?見過ごされたpreloadが技術的負債として爆発した日
mugitti9
2
3.2k
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
220
CSC509 Lecture 04
javiergs
PRO
0
300
デミカツ切り抜きで面倒くさいことはPythonにやらせよう
aokswork3
0
220
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
230
CSC305 Lecture 04
javiergs
PRO
0
260
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Facilitating Awesome Meetings
lara
56
6.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
54
3k
Why Our Code Smells
bkeepers
PRO
339
57k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
RailsConf 2023
tenderlove
30
1.2k
Designing Experiences People Love
moore
142
24k
The Invisible Side of Design
smashingmag
301
51k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.9k
How to Think Like a Performance Engineer
csswizardry
27
2k
BBQ
matthewcrist
89
9.8k
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