Search:

Type: Posts; User: OutputStream

Search: Search took 0.06 seconds.

  1. Re: The java-output doesn't give the right result?

    If you remove the synchronized keyword from both methods then you would probably get different results every time you run the program.
    There is nothing wrong with the loops, they are looping exactly...
  2. Re: The java-output doesn't give the right result?

    Basic math:
    3 * 2'000'000 = 6'000'000
    1 * 2'000'000 = 2'000'000

    Add them together and you get 8'000'000.
    How can 7'999'982 be the right output?
Results 1 to 2 of 2