Method does not accept passing from null to parameter

Asked

Viewed 101 times

2

I have the following method:

public String insereRegistro(int tipo, String data, String horario, String historico,
                                  int veiculo, double km, int cliente, int solicitante,
                                  String finalizado) {
   ...
}

How do I make the method accept the null value ?

1 answer

4


You can pass null in all parameters other than primitive types.

If you want to do the same in primitive type parameters, replace them with the respective classes:

public String insereRegistro(Integer tipo, String data, String horario, String historico,
                             Integer veiculo, Double km, Integer cliente, Integer solicitante,
                             String finalizado) {
   ...
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.