Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Rectángulo:
  2.  
  3. public String Nombre() {
  4. nombre = "Este es un rectángulo de base " + base + " y altura " + altura;
  5. return nombre;
  6. }
  7.  
  8. public int Area() {
  9.  
  10. return base * altura;
  11. }
  12.  
  13.  
  14.  
  15. Pantalla:
  16.  
  17. public void muestra_Pantalla() {
  18. for (int i = 0; i < cantidad; i++) {
  19. listaFiguras.get(i).Nombre();
  20. listaFiguras.get(i).Area();
  21. listaFiguras.get(i).Dibujar();
  22. }
  23. }
  24.  
  25.  
  26. Main:
  27. p1.muestra_Pantalla();
  28.  
  29.  
  30. Y solo lo dibuja, pero ni saca el nombre ni el área
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement