-
-
Save jesuscampos/371cb3cf81ec673796b59291a5fa5d20 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
| class Coche | |
| { | |
| public static Coche DameDeportivo() | |
| { | |
| Coche coche = new Coche(2000); | |
| coche.velocidades = 6; | |
| return coche; | |
| } | |
| public static Coche DameTurismo() | |
| { | |
| Coche coche = new Coche(1400); | |
| return coche; | |
| } | |
| private int cvs = 5; | |
| private int velocidades; | |
| private Coche(int cvs) // Constructor privado | |
| { | |
| this.cvs = cvs; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment