Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save manfe/5932351 to your computer and use it in GitHub Desktop.
Aprendendo Java - Detalhado
public class Eletrodomestico {
protected boolean ligado;
protected int voltagem;
protected int consumo;
// getters e setters
// ...
}
public class Main {
public static void main(String[] args) {
TV t1 = new TV();
t1.ligado = false;
t1.voltagem = 110;
t1.tamanho = 20;
System.out.println("Ligado: " + t1.ligado);
}
}
public class TV extends Eletrodomestico {
private int canal;
private int volume;
private int tamanho;
public TV() {
}
// (...)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment