Last active
November 6, 2016 16:37
-
-
Save gorkamu/48c0c5a623b69cb18cc1ac4f086aba30 to your computer and use it in GitHub Desktop.
Ejemplo de clase en php
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
<?php | |
class PaqueteDeTabaco | |
{ | |
// Declaración de propiedades | |
private $altura = 50; | |
private $anchura = 20; | |
// Declaración de métodos | |
public function cualEsLaAltura() { | |
return $this->altura; | |
} | |
public function cualEsLaAnchura() { | |
return $this->anchura; | |
} | |
public function abrirPaquete() { | |
... | |
} | |
public function comprobarSiHayTabaco() { | |
... | |
} | |
public function sacarCigarrillo() { | |
... | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment