-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
33 lines (24 loc) · 844 Bytes
/
Copy pathMain.java
File metadata and controls
33 lines (24 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package exercise01;
public class Main {
public static void main(String[] args) {
// Instanciando objetos:
Gato gato = new Gato ();
Cachorro cachorro = new Cachorro ();
Galo galo = new Galo ();
Pato pato = new Pato ();
// Exibindo resultados através dos principais metódos da interface:
System.out.println("=== Exibindo resultados ===");
System.out.printf("\nGATO: \n\n");
System.out.println(gato.emitirSom());
System.out.println(gato.comer());
System.out.printf("\nCACHORRO: \n\n");
System.out.println(cachorro.emitirSom());
System.out.println(cachorro.comer());
System.out.printf("\nGALO: \n\n");
System.out.println(galo.emitirSom());
System.out.println(galo.comer());
System.out.printf("\nPATO: \n\n");
System.out.println(pato.emitirSom());
System.out.println(pato.comer());
}
}