Skip to content

Instantly share code, notes, and snippets.

@DeveloperArthur
Created March 17, 2020 16:10
Show Gist options
  • Save DeveloperArthur/9909a44d87fca5e4aa70ac2a8a31302f to your computer and use it in GitHub Desktop.
Save DeveloperArthur/9909a44d87fca5e4aa70ac2a8a31302f to your computer and use it in GitHub Desktop.
package br.com.meubuscadordecep.cliente;
import br.com.meubuscadordecep.dominio.Endereco;
import br.com.meubuscadordecep.viacep.ServicoDeCep;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
System.out.print("Informe seu CEP: ");
String cep = new Scanner(System.in).nextLine();
Endereco endereco = ServicoDeCep.buscaEnderecoPelo(cep);
System.out.println("Logradouro: " + endereco.getLogradouro());
System.out.println("Bairro: " + endereco.getBairro());
System.out.println("Localidade: " + endereco.getLocalidade());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment