Advertisement
hercioneto

Exercicio class Tabuada

Nov 14th, 2023
631
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. public class Tabuada {
  2.     private Integer numero;
  3.  
  4.     public Integer getNumero() {
  5.         return numero;
  6.     }
  7.  
  8.     public void setNumero(Integer numero) {
  9.         this.numero = numero;
  10.     }
  11.    
  12.     public void executar(){
  13.         Integer valor;
  14.         for (int i = 1; i <= 10; i++) {
  15.             valor = this.getNumero()*i;
  16.             System.out.println(this.getNumero() + " * " + i + " = " + valor);
  17.         }
  18.    
  19.     }
  20.    
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement