Created
July 5, 2013 06:06
-
-
Save manfe/5932281 to your computer and use it in GitHub Desktop.
Aprendendo Java - Detalhado
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
| public class Main{ | |
| public static void main (String args []){ | |
| TV minhaTV = new TV(); | |
| System.out.println(minhaTV.volume); | |
| minhaTV.aumentarVolume(); | |
| System.out.println(minhaTV.volume); | |
| } | |
| } |
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
| public class TV { | |
| int canal; | |
| int volume; | |
| boolean ligada; | |
| int tamanho; | |
| public TV(){ | |
| this.tamanho = 21; | |
| this.ligada = true; | |
| this.canal = 3; | |
| this.volume = 25; | |
| } | |
| public void aumentarVolume(){ | |
| this.volume += 5; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment