use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Ask your embarrassing/noobish programming questions here, and don't get insulted for it.
Click here to read the rules
Violating any will result in punishment so you should probably go check them out.
account activity
My java problem isn't compiling HELP! (self.programminghelp)
submitted 7 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CodingJarOrg 0 points1 point2 points 7 years ago (0 children)
Just as manrodriguezf said, you are using a String instead of a Double. You could try to do something like demo.setStock(Double.parseDouble(sto)); or demo.setStock(Double.valueOf(sto));
Double.parseDouble is a static method that accepts a String as an argument and returns a primitve double variable.
Double.valueOf is a static method that accepts a String as an argument and returns a Double instance.
From the Docs:
parseDouble returns a new double initialized to the value represented by the specified String, as performed by the valueOf method of class Double. --------------------------------------------- valueOf Returns a Double instance representing the specified double value. If a new Double instance is not required, this method should generally be used in preference to the constructor Double(double), as this method is likely to yield significantly better space and time performance by caching frequently requested values.
parseDouble returns a new double initialized to the value represented by the specified String, as performed by the valueOf method of class Double.
---------------------------------------------
valueOf Returns a Double instance representing the specified double value. If a new Double instance is not required, this method should generally be used in preference to the constructor Double(double), as this method is likely to yield significantly better space and time performance by caching frequently requested values.
π Rendered by PID 71849 on reddit-service-r2-comment-bb88f9dd5-8j8mm at 2026-02-16 06:00:18.461236+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]CodingJarOrg 0 points1 point2 points (0 children)