-2
I need help to run a class, it’s a college exercise, I don’t know how to finish.
Only this last class left to finish the project.
I need to create a class TesteProjeto
with the structure main
.
In this structure I need to call a class and already pass the parameters on it. How do I do this?
Follow what I’ve done:
public class OrdemServico {
private int id;
private long dataSolicitacao;
private long dataInicio;
private long dataFim;
private double ValorTotal;
private Cliente cliente;
private Atendente atendente;
private Tecnico tecnico;
private Material material;
private Servico servico;
public OrdemServico(int id, long dataSolicitacao, long dataInicio, long dataFim, double ValorTotal, String cliente, String atendente, String tecnico, String Material, String Servico)
{
// inicializa variáveis de instância
this.id = id;
this.dataSolicitacao = dataSolicitacao;
this.dataInicio = dataInicio;
this.dataFim = dataFim;
this.ValorTotal = ValorTotal;
//this.cliente = new Cliente();
//this.cliente = cliente.getNome();
}
public void exibeInformacoes(){
System.out.println("OrdemServico: ");
System.out.println("ID: " + id);
System.out.println("Data Solicitacao: " + dataSolicitacao);
System.out.println("Data Inicio: " + dataInicio);
System.out.println("Data Fim: " + dataFim);
System.out.println("Valor Total: " + ValorTotal);
System.out.println("Cliente: " + cliente);
System.out.println("Atendente: " + atendente);
System.out.println("Tecnico: " + tecnico);
System.out.println("Material: " + material);
System.out.println("Servico: " + servico);
}
}
Now I need to do the main
. What I’ve done, but it’s a little wrong:
class TesteProjeto
{ // classe de testes
public static void main(String args[])
{
OrdemServico ordem = new OrdemServico();
System.out.println("Teste");
}
}
You can help me in how?
I don’t know if I understand what you want, but basically just call the builder you created by passing the arguments you want, this is what you don’t know how to do?
– Maniero
You have not demonstrated or mentioned this in the question, so the question is not clear.
– Maniero