Skip to content

Commit f4d0f06

Browse files
authored
Create Motorcycle.java - Exercício 1
1 parent 8dc8b10 commit f4d0f06

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Motorcycle.java - Exercício 1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package javaaula;
2+
3+
public class Motorcycle extends Vehicle {
4+
5+
public static void main(String[] args) {
6+
Vehicle vel = new Vehicle();
7+
vel.go();
8+
//VEICULO
9+
System.out.println("Wheels of Vehicle: " + vel.wheels());
10+
//MOTOCICLETA
11+
Motorcycle mot = new Motorcycle();
12+
System.out.println("Wheels of Motorcycle: " + mot.wheels());
13+
}
14+
15+
@Override
16+
public int wheels() {
17+
return 2;
18+
}
19+
}

0 commit comments

Comments
 (0)