Skip to content

Instantly share code, notes, and snippets.

@bitmaybewise
Last active December 14, 2015 13:18
Show Gist options
  • Save bitmaybewise/5092082 to your computer and use it in GitHub Desktop.
Save bitmaybewise/5092082 to your computer and use it in GitHub Desktop.
Tipagem fraca/forte e inferência de tipo
using System;
public class InferenciaDeTipo
{
public static void Main(String[] args)
{
int valor1 = 10;
String valor2 = "Valor";
var permitido1 = 1;
var permitido2 = "Permitido";
}
}
public class InferenciaDeTipo {
public static void main(String[] args){
int valor1 = 10;
String valor2 = "Valor";
naoPermitido = 42;
}
}
print 42.0 - " resposta pra tudo no universo "
puts 42 + "tipagem forte"
// WTF
console.log(10 + true);
<?php
// WTF
echo "5 laranjas" + 10 . "\n";
echo 10 + "5 laranjas" . "\n";
// OK
echo 10 . "5 laranjas" . "\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment