Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package oop;
- public class lista_de_exercicios {
- private String nome;
- private int idade;
- private double peso;
- public void nascer (String n, double p) {
- this.idade= 0;
- this.nome = n;
- this.peso = p;
- }
- public void fazerAniversario (){
- this.idade = this.idade + 1;
- }
- public void engordar (double kgs) {
- this.peso = this.peso + kgs;
- }
- public void emagrecer (double kgs) {
- this.peso = this.peso - kgs;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement