-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Programación Orientada a Objetos Clases y métodos abstractos (Curso d…
…e Kotlin desde cero [67]) Video: https://youtu.be/n0RBWO5rem4
- Loading branch information
1 parent
7fc26da
commit 13a2beb
Showing
7 changed files
with
30 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
abstract class Automotores{ | ||
abstract fun llantas() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Autos:Automotores(){ | ||
override fun llantas(){ | ||
println("Este auto solo tiene 4 llantitas") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Camiones:Diesel(){ | ||
override fun llantas(){ | ||
println("Este camion solo tiene 8 llantitas") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
abstract class Diesel :Automotores(){ | ||
abstract override fun llantas() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
abstract class Gasolina :Automotores(){ | ||
abstract override fun llantas() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Motocicletas:Automotores(){ | ||
override fun llantas(){ | ||
println("Esta motocileta solo tiene 2 llantitas") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
import javax.swing.JOptionPane | ||
|
||
fun main(args:Array<String>){ | ||
var a=Animal() | ||
a.comer() | ||
a.correr() | ||
var h=Humano() | ||
h.correr() | ||
h.comer() | ||
var p=Perro() | ||
p.comer() | ||
p.correr() | ||
var pajaro=Pajaro() | ||
pajaro.correr() | ||
pajaro.volar() | ||
var m=Motocicletas() | ||
m.llantas() | ||
var a=Autos() | ||
a.llantas() | ||
var c=Camiones() | ||
c.llantas() | ||
} |