-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inferência de tipos em variáveis locais
- Loading branch information
1 parent
e14a347
commit 247d33c
Showing
6 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Novas Características do Java 10 | ||
|
||
* Inferência de tipos em variáveis locais; | ||
* Mudanças no Garbage-Collector; | ||
* Versionamento com base no tempo; | ||
* Alocação de memória alternativa. |
11 changes: 11 additions & 0 deletions
11
Secao-4-Java-10-New-Features/aula-25/InferenciaDeTipoVarPrj/InferenciaDeTipoVarPrj.iml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | ||
</content> | ||
<orderEntry type="jdk" jdkName="10" jdkType="JavaSDK" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
22 changes: 22 additions & 0 deletions
22
Secao-4-Java-10-New-Features/aula-25/InferenciaDeTipoVarPrj/src/VarExemplo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import java.util.List; | ||
|
||
public class VarExemplo { | ||
public static void main(String[] args) { | ||
|
||
// var a1 = "Programando em "; | ||
// String a2 = "Java"; | ||
// System.out.println(a1 + a2); | ||
|
||
var listaDeFrutas = List.of("Banana","Maçã","Abacaxi"); | ||
//Enhaced For | ||
for (var fruta : listaDeFrutas){ | ||
System.out.println(fruta); | ||
} | ||
System.out.println("**---**"); | ||
//Índice laço For | ||
for (var i=0; i<listaDeFrutas.size(); i++){ | ||
System.out.println(listaDeFrutas.get(i)); | ||
} | ||
|
||
} | ||
} |