简体   繁体   中英

Error when i use Double in Codenameone

Can't understand why I am getting this error when I declare Double dblLng .

valueOf(java.lang.String) in java.lang.Double cannot be applied to (double)
    Double dblLng = 0.0d;
Fatal Error: Unable to find method valueOf

You need to use one of:

double dblLng = 0.0;

Or:

Double dblLng = new Double(0.0);

The reason you are getting this is due to autoboxing which seamlessly converts double to Double (if you don't understand the difference google Java autoboxing). This is a bug in the current version of Codename One where the valueOf methods required for autoboxing are missing from the whitelisted Java classes, I'll have a look at fixing it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM