Skip to content

Instantly share code, notes, and snippets.

@sergiosvieira
Created September 18, 2020 15:48
Show Gist options
  • Save sergiosvieira/f9773fe8d3c6743beac5a61f4c9f63fe to your computer and use it in GitHub Desktop.
Save sergiosvieira/f9773fe8d3c6743beac5a61f4c9f63fe to your computer and use it in GitHub Desktop.
Semana 02 - Interfaces
import java.util.*;
import java.time.LocalDate;
enum Sexo {M, F};
interface ICadastro {
void nome(String valor);
void cpf(int valor);
void rg(int valor);
void uf(String valor);
void dataNascimento(LocalDate valor);
void sexo(Sexo valor);
void email(String Valor);
}
class Cliente implements ICadastro {
public void nome(final String valor) {
System.out.println("Nome do cliente:" + valor);
}
public void cpf(final int valor) {
System.out.println("CPF do cliente:" + valor);
}
public void rg(final int valor) {
System.out.println("RG do cliente:" + valor);
}
public void uf(final String valor) {
System.out.println("UF do cliente:" + valor);
}
public void dataNascimento(final LocalDate valor) {
System.out.println("Data de Nascimento do cliente:" + valor);
}
public void sexo(final Sexo valor) {
System.out.println("Sexo do cliente:" + valor);
}
public void email(final String valor) {
System.out.println("Email do cliente:" + valor);
}
}
class Banco {
public static void main(final String[] args) {
final Cliente c1 = new Cliente();
c1.nome("Sérgio Vieira");
c1.cpf(123456798);
c1.rg(1234679);
c1.uf("CE");
c1.dataNascimento(LocalDate.of(2010, 1, 1));
c1.sexo(Sexo.M);
c1.email("sergio.vieira@ifce.edu.br");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment