Created
May 16, 2014 12:13
-
-
Save jorgeguberte/401a5e01acd03254e666 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
NomeDaClasse{ | |
public int variavel_da_classe; | |
private int outra_variavel_da_classe; | |
function doSomething(){ | |
//faz algo. | |
outra_variavel_da_classe; //A variável é privada, mas como está dentro da classe, pode ser acessada. | |
} | |
} | |
var classe = new NomeDaClasse(); | |
classe.doSomething(); | |
classe.variavel_da_classe; //Essa você acessa pq é publica | |
classe.outra_variavel_da_classe; //Essa é privada, então não dá pra acessar de fora da classe. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment