0
I have a field in the Mysql Date database and within a function modelPie.set(String, number)
I want to bring this field but java says it cannot convert from Date
for Number
.
0
I have a field in the Mysql Date database and within a function modelPie.set(String, number)
I want to bring this field but java says it cannot convert from Date
for Number
.
1
Friend the question is quite incomplete, but I will try to answer objectively.
Java does not make the conversion implicit, only in the case of inheritances. As the class of number and date has no relation it even complains.
Use the method getTime class Date
.
modelPie.set("Nome", data.getTime());
Browser other questions tagged java java-ee type-conversion
You are not signed in. Login or sign up in order to post.
Welcome to [en.so]. It would help if you post the code snippet that error and the error message.
– user7261