Skip to content

Commit

Permalink
Inferência de tipos em variáveis locais
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagogomes187 committed Dec 26, 2023
1 parent e14a347 commit 247d33c
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Secao-3-Java-9-New-Features/aula-23/HTTP2Prj/HTTP2Prj.iml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="9" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
6 changes: 6 additions & 0 deletions Secao-4-Java-10-New-Features/aula-24/file.txt
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.
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>
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));
}

}
}

0 comments on commit 247d33c

Please sign in to comment.