Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // uma possível classe Pessoa
- // java
- public class Pessoa
- {
- private String nome;
- private int idade;
- private char sexo;
- public Pessoa(String nome, int idade, char sexo)
- {
- this.nome = nome;
- this.idade = idade;
- this.sexo = sexo;
- }
- public String getNome()
- {
- return nome;
- }
- public int getIdade()
- {
- return idade;
- }
- public char getSexo()
- {
- return sexo;
- }
- }
- // scala
- class Pessoa(val nome: String, val idade: Int, val sexo: Char)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement