MCPcopy Create free account
hub / github.com/JerePrograma/FullStackEgg / Animal

Class Animal

Etapa3Herencia/Ejercicio1/src/entidad/Animal.java:8–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6package entidad;
7
8public class Animal {
9
10 private String nombre;
11 private String alimento;
12 private int edad;
13 private String raza;
14
15 public Animal() {
16 }
17
18 public Animal(String nombre, String alimento, int edad, String raza) {
19 this.nombre = nombre;
20 this.alimento = alimento;
21 this.edad = edad;
22 this.raza = raza;
23 }
24
25 public void alimentarse() {
26 System.out.println(this.nombre + " se alimenta con " + this.alimento);
27 }
28
29 public String getNombre() {
30 return nombre;
31 }
32
33 public void setNombre(String nombre) {
34 this.nombre = nombre;
35 }
36
37 public String getAlimento() {
38 return alimento;
39 }
40
41 public void setAlimento(String alimento) {
42 this.alimento = alimento;
43 }
44
45 public int getEdad() {
46 return edad;
47 }
48
49 public void setEdad(int edad) {
50 this.edad = edad;
51 }
52
53 public String getRaza() {
54 return raza;
55 }
56
57 public void setRaza(String raza) {
58 this.raza = raza;
59 }
60
61}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected