Skip to content

Instantly share code, notes, and snippets.

@jesuscampos
Created December 5, 2017 19:28
Show Gist options
  • Select an option

  • Save jesuscampos/371cb3cf81ec673796b59291a5fa5d20 to your computer and use it in GitHub Desktop.

Select an option

Save jesuscampos/371cb3cf81ec673796b59291a5fa5d20 to your computer and use it in GitHub Desktop.
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