Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package loja;
- public class Cliente {
- private final int codCliente;
- public String nome;
- static int cont;
- //CONSTRUTOR
- public Cliente(String nome) {
- this.nome = nome;
- this.codCliente = Cliente.cont + 1;
- Cliente.cont++;
- }
- public String getNome() {
- return nome;
- }
- public void setNome(String nome) {
- this.nome = nome;
- }
- public int getCodCliente() {
- return this.codCliente;
- }
- public void dadosCliente() {
- System.out.println("Cliente: " + this.getNome());
- System.out.println("Código: " + this.getCodCliente());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement