Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. package campeonato;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. public class Time {
  6.  
  7. private static ArrayList<Time> times = new ArrayList<Time>();
  8. private String nome;
  9. private String cidade;
  10.  
  11. public static void addTime(Time ts) {
  12. times.add(ts);
  13. }
  14.  
  15. public Time() {
  16. }
  17.  
  18. public Time(String nome, String cidade) {
  19. this.setNome(nome);
  20. this.setCidade(cidade);
  21. }
  22.  
  23. public String imprimeTime() {
  24. String saida;
  25. saida = "\nNome: " + getNome() + "\nCidade: " + getCidade();
  26. return saida;
  27. }
  28.  
  29. public String getNome() {
  30. return nome;
  31. }
  32.  
  33. public void setNome(String nome) {
  34. this.nome = nome;
  35. }
  36.  
  37. public String getCidade() {
  38. return cidade;
  39. }
  40.  
  41. public void setCidade(String cidade) {
  42. this.cidade = cidade;
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement