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
86
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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.2k
Serving TUIs over SSH with Go
caarlos0
0
2.4k
construindo uma carreira com opensource
caarlos0
0
570
Introdução ao GoReleaser
caarlos0
0
1.3k
Intro to GoReleaser
caarlos0
0
1.3k
Intro to GoReleaser
caarlos0
0
1.8k
Gerenciando Projetos OpenSource
caarlos0
0
1.7k
GoReleaser: Lessons Learned (hacktoberfest)
caarlos0
0
2.1k
GoReleaser: Lessons Learned
caarlos0
0
3k
Other Decks in Programming
See All in Programming
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
850
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
210
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
690
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
210
AIが無かった頃の素敵な出会いの話
codmoninc
1
430
Google Apps Script で Ruby を動かす
kawahara
0
220
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
120
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
110
仕様駆動開発の消費期限
watany
20
8.2k
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
270
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
180
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
110
Featured
See All Featured
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
370
Technical Leadership for Architectural Decision Making
baasie
3
470
How to train your dragon (web standard)
notwaldorf
97
6.8k
Product Roadmaps are Hard
iamctodd
55
12k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
Building an army of robots
kneath
306
46k
Chasing Engaging Ingredients in Design
codingconduct
0
270
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
350
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
380
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
200
Mobile First: as difficult as doing things right
swwweet
225
10k
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