Skip to content

Instantly share code, notes, and snippets.

@marciojrtorres
Created August 5, 2013 20:36
Show Gist options
  • Save marciojrtorres/6159385 to your computer and use it in GitHub Desktop.
Save marciojrtorres/6159385 to your computer and use it in GitHub Desktop.
Na linguagem C# as variáveis tem os tipos pré-definidos, uma característica da tipagem estática
// declaração da variável
int num = 32;
// ok, a variável num é do tipo inteiro e tem o valor 32
// atribuição de valor à variável:
num = 98;
// ok, a variável tem o valor 98
num = 54.23;
// erro! 54.23 não é um número inteiro, então não pode ter esse valor
num = "texto";
// erro! strings não são aceitas em variáveis do tipo inteiro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment