Created
October 25, 2017 21:12
-
-
Save AlvarezAriel/ac4d5ea0ed8cda215965f491d235d53f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| package ar.edu.unq.obj3.ejercicio | |
| trait ConNombre { | |
| def nombre:String | |
| } | |
| class Humano(val nombre:String, val altura:Int) extends ConNombre | |
| class SuperHeroe(val identidad:ConNombre, val disfraz: Disfraz) | |
| object SuperHeroe { | |
| def crearDisfraz(normal:Humano):Disfraz = new Disfraz(normal.altura) | |
| def vestir(conNombre: ConNombre, disfraz: Disfraz) = new SuperHeroe(conNombre,disfraz) | |
| } | |
| class Disfraz(val largo:Int) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment