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
41
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
Introdução ao GoReleaser
caarlos0
0
940
Intro to GoReleaser
caarlos0
0
890
Intro to GoReleaser
caarlos0
0
1.3k
Gerenciando Projetos OpenSource
caarlos0
0
1.4k
GoReleaser: Lessons Learned (hacktoberfest)
caarlos0
0
1.7k
GoReleaser: Lessons Learned
caarlos0
0
2.2k
Go 1.10 Release Party @ Joinville Go Meetup
caarlos0
0
1.9k
Monitoring @ ContaAzul
caarlos0
0
2.1k
Building and Releasing Golang binaries
caarlos0
1
2.1k
Other Decks in Programming
See All in Programming
slow types ってなんだろう?
karad
0
210
地方こそサーバーレス、その意義に迫るサーバーレスPHP / Serverless PHP: The Rural Areas, and Why Serverless PHP Matters
seike460
PRO
2
110
Amazon Aurora Serverless v2が意外と高かった話と、AWS Database Migration Serviceの話
satoshi256kbyte
1
110
哲学史とモデリング
tanakahisateru
4
440
欠陥を早期に発見するための Software Engineer in Test とその重要性 / What is Software Engineer in Test and How they works
orgachem
PRO
19
2.6k
The Final Frontier of Web Development: React Server Components vs Jakarta EE
ivargrimstad
0
260
RailsConf 2024: Riffing on Rails: sketch your way to better designed code
kaspth
1
220
FoodGram
iseruuuuu
0
230
TypeScriptコードの漸進的改善 / Progressive Improvement of TypeScript Code
medley
1
480
The Hotwire Landscape After Turbo 8 @ Helvetic Ruby 2024, Zurich
marcoroth
0
120
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
1
140
The World is a Network (and We Are Just Nodes)
whatyouhide
0
110
Featured
See All Featured
Side Projects
sachag
451
41k
Designing for humans not robots
tammielis
247
25k
Code Review Best Practice
trishagee
56
15k
How STYLIGHT went responsive
nonsquared
92
4.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
47k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
117
18k
For a Future-Friendly Web
brad_frost
172
9k
The Cult of Friendly URLs
andyhume
74
5.7k
Build your cross-platform service in a week with App Engine
jlugia
227
17k
Statistics for Hackers
jakevdp
790
220k
Building Adaptive Systems
keathley
32
1.9k
Mobile First: as difficult as doing things right
swwweet
217
8.6k
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