Advertisement
Guest User

Classe Cliente

a guest
Dec 5th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. package loja;
  2.  
  3. public class Cliente {
  4.  
  5.     private final int codCliente;
  6.     public String nome;
  7.     static int cont;
  8.  
  9.     //CONSTRUTOR
  10.     public Cliente(String nome) {
  11.         this.nome = nome;
  12.         this.codCliente = Cliente.cont + 1;
  13.         Cliente.cont++;
  14.     }
  15.  
  16.     public String getNome() {
  17.         return nome;
  18.     }
  19.  
  20.     public void setNome(String nome) {
  21.         this.nome = nome;
  22.     }
  23.  
  24.     public int getCodCliente() {
  25.         return this.codCliente;
  26.     }
  27.  
  28.     public void dadosCliente() {
  29.         System.out.println("Cliente: " + this.getNome());
  30.         System.out.println("Código: " + this.getCodCliente());
  31.  
  32.     }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement