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
63
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.7k
Serving TUIs over SSH with Go
caarlos0
0
1.4k
construindo uma carreira com opensource
caarlos0
0
410
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.9k
GoReleaser: Lessons Learned
caarlos0
0
2.5k
Other Decks in Programming
See All in Programming
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
410
ファインディ株式会社におけるMCP活用とサービス開発
starfish719
0
110
旅行プランAIエージェント開発の裏側
ippo012
2
860
ECS初心者の仲間 – TUIツール「e1s」の紹介
keidarcy
0
150
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
440
react-callを使ってダイヤログをいろんなとこで再利用しよう!
shinaps
1
190
[FEConf 2025] 모노레포 절망편, 14개 레포로 부활하기까지 걸린 1년
mmmaxkim
0
1.5k
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
1
610
RDoc meets YARD
okuramasafumi
4
160
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
140
rage against annotate_predecessor
junk0612
0
160
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
How STYLIGHT went responsive
nonsquared
100
5.8k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
840
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Done Done
chrislema
185
16k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
Code Reviewing Like a Champion
maltzj
525
40k
Fireside Chat
paigeccino
39
3.6k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
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