Skip to content

Instantly share code, notes, and snippets.

@manfe
Created July 5, 2013 06:06
Show Gist options
  • Select an option

  • Save manfe/5932281 to your computer and use it in GitHub Desktop.

Select an option

Save manfe/5932281 to your computer and use it in GitHub Desktop.
Aprendendo Java - Detalhado
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);
}
}
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