Created
February 21, 2017 20:01
-
-
Save Rafael11j/219bc94ac6ed4e170c3ac4e56da58d21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Cadastro; | |
import java.util.Scanner; | |
public class Produto { | |
private String id; | |
private String nome; | |
private String tipo; | |
private String marca; | |
private String descricao; | |
private Scanner abre; | |
private String r; | |
public String getId() { | |
abre = new Scanner(System.in); | |
System.out.println("Digite o Id: "); | |
r = abre.nextLine(); | |
return id; | |
} | |
public void setId(String id) { | |
this.id = id; | |
} | |
public String getNome() { | |
System.out.println("Digite o nome: "); | |
r = abre.nextLine(); | |
return nome; | |
} | |
public void setNome(String nome) { | |
this.nome = nome; | |
} | |
public String getTipo() { | |
System.out.println("Digite o tipo: "); | |
r = abre.nextLine(); | |
return tipo; | |
} | |
public void setTipo(String tipo) { | |
this.tipo = tipo; | |
} | |
public String getMarca() { | |
System.out.println("Digite a marca: "); | |
r = abre.nextLine(); | |
return marca; | |
} | |
public void setMarca(String marca) { | |
this.marca = marca; | |
} | |
public String getDescricao() { | |
System.out.println("Descreva o produto: "); | |
r = abre.nextLine(); | |
return descricao; | |
} | |
public void setDescricao(String descricao) { | |
this.descricao = descricao; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Cadastro; | |
import java.util.Scanner; | |
public class ProdutoDao { | |
String r; | |
Scanner abre = new Scanner(System.in); | |
Produto d = new Produto(); | |
public void cadastrar(){ | |
d.getId(); | |
d.getNome(); | |
d.getMarca(); | |
d.getTipo(); | |
d.getDescricao(); | |
} | |
public void atualizar(){ | |
System.out.println("Atualizar produto"); | |
} | |
public void excluir(){ | |
System.out.println("Excluir produto"); | |
} | |
public static void main(String[] args){ | |
ProdutoDao c = new ProdutoDao(); | |
c.cadastrar(); | |
c.atualizar(); | |
c.excluir(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment