This file contains hidden or 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
| fun main() { | |
| val eitler = Analista( "Eitler Pereira", "1234567899", 1000.01) | |
| ImprimeRelatorioFuncionario.imprime(eitler) | |
| val joao = Gerente( "João Silva", "9876543211", 2000.04, "123") | |
| ImprimeRelatorioFuncionario.imprime(joao) | |
| ValidaAutentica().autentica(joao) | |
| } |
This file contains hidden or 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
| fun main() { | |
| // println("Nome do funcionário......: ${eitler.nome}") | |
| // println("Cpf do funcionário.......: ${eitler.cpf}") | |
| // println("Salário do funcionário...: ${eitler.salario}") | |
| val eitler = Analista( "Eitler Pereira", "1234567899", 1000.01) | |
| // imprimeRelatorio(eitler) | |
| ImprimeRelatorioFuncionario.imprime(eitler) |
This file contains hidden or 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
| fun main() { | |
| val numbers = listOf(3,9,0,1,2) | |
| println("Operador in") | |
| //O operador "in" verifica se o número "x", está contido numa lista qualquer de números | |
| println(12 in numbers) | |
| println(1 in numbers) | |
This file contains hidden or 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
| const val MIN_AGE = 16 | |
| const val MAX_AGE = 68 | |
| var numberX = 5 | |
| var numberY = 4 | |
| fun main() { | |
| println("EXEMPLO A:") | |
| exampleA() |
This file contains hidden or 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
| //Aqui as "CONSTANTES" eliminam o uso do número mágico no código, | |
| //evitando que os valores sejam inseridos diretamente(hardcode), | |
| //o que também funcionaria mas reduziria a qualidade do código. | |
| const val EQUAL = 0 | |
| const val LESS = -1 | |
| const val MORE = 1 | |
| val a = 2 | |
| val b = 3 |
This file contains hidden or 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
| fun main() { | |
| /** | |
| * Os operadores podem ser chamados tanto como "expressão" | |
| * quanto como "comandos". O resultado será o mesmo. | |
| * | |
| * A função de soma também funciona para concatenar(unir) Strings. | |
| * **/ | |
| var numberPlusA = 5 |
This file contains hidden or 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
| const val MIN_AGE = 37 | |
| const val MAX_AGE = 38 | |
| fun main() { | |
| //Constante "SNAKE_CASE" imutável com inferência dinâmica de tipo (inteiro) definida ao receber valor | |
| println("Idade relatada mínima é $MIN_AGE e máxima $MAX_AGE") | |
| //TODO - INSERIDO CASO DE ERRO POR NÃO ATRIBUIR VALOR/TIPO NA CRIAÇÃO DA VARIÁVEL |
This file contains hidden or 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
| fun main() { | |
| var variableByte: Byte = Byte.MAX_VALUE | |
| var variableInteger: Int = Int.MAX_VALUE | |
| var variableLong: Long = Long.MAX_VALUE | |
| var variableFloat: Float = Float.MAX_VALUE | |
| var variableDouble: Double = Double.MAX_VALUE | |
| println("BYTE......: ${variableByte}") |
NewerOlder