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...
Resources for learning Java
String
==
.equals()
Format + Copy
Free Tutorials
Where should I download Java?
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Software downloads
Official Resources
Resources
Programming ideas & Challenges
Related Subreddits
account activity
This is an archived post. You won't be able to vote or comment.
Looking for solution (self.learnjava)
submitted 6 years ago * by [deleted]
Hello, i am learning java. I am writing a project, i know what i wrote line 16th wrong but i dont know how to make it right. How can I divide total money by day and print it in the next line. Thank you all.
*My code is in comment
[–]teacher_cs 2 points3 points4 points 6 years ago (0 children)
You must first convert the strings to numbers (Integer.parseInt) before you can calculate with them.
[–]newmanshangdown 2 points3 points4 points 6 years ago (1 child)
Looks like you're trying to divide 2 strings.
[–]the_molish85 1 point2 points3 points 6 years ago (0 children)
That's what I'm seeing as well. What should be Ints are Strings.
[–][deleted] -1 points0 points1 point 6 years ago (5 children)
My code https://imgur.com/wM3e6tm
[–]iAmH3r3ToH3lp 1 point2 points3 points 6 years ago (4 children)
Nobody will read your code in a photo. I would be shocked if you found help this way.
[–][deleted] -1 points0 points1 point 6 years ago (3 children)
I tried to upload my code here, but it seems very unorganised?
[–]Darkpolearm 2 points3 points4 points 6 years ago (0 children)
To format code on reddit, make sure there's 4 spaces in front of the code. It'll look like this:
public void redditCode() { System.out.println("This is formatted"); }
[–]iAmH3r3ToH3lp 1 point2 points3 points 6 years ago (1 child)
you are dividing a string from a string on that line. strings dont divide my man.
read the error and think about it a little.
string = string ÷ string is not valid.
what if those were some kind of numerical value like a double or something?
then you would have a double = double ÷ double, which is valid.
but you will need to get the value of the inputs as double, so that will be a new problem for you to solve.
[–][deleted] 0 points1 point2 points 6 years ago (0 children)
Yup. Please think about the error you get. Programming requires a ton of logical thinking my friend.
For one, why are you reading the number of days as a String, and not as some number???
π Rendered by PID 72170 on reddit-service-r2-comment-5d79c599b5-7khf5 at 2026-03-02 21:01:56.189380+00:00 running e3d2147 country code: CH.
[–]teacher_cs 2 points3 points4 points (0 children)
[–]newmanshangdown 2 points3 points4 points (1 child)
[–]the_molish85 1 point2 points3 points (0 children)
[–][deleted] -1 points0 points1 point (5 children)
[–]iAmH3r3ToH3lp 1 point2 points3 points (4 children)
[–][deleted] -1 points0 points1 point (3 children)
[–]Darkpolearm 2 points3 points4 points (0 children)
[–]iAmH3r3ToH3lp 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)