Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Don't know what the problem is, and you will have to explain "stuck in the return statement". Code does not simply get "stuck".</p> <p>But you will help yourself a lot of you break the problem up.</p> <p>For example, if you created a class and handled instances of the class rather than untyped arrays of objects, your code would be much easier to write, much easier to debug and much easier to maintain. Doing so will also enable the compiler to catch a lot of errors before you need to ask for help :)</p> <p>Whenever you are tempted to use 'Object', you should stop and question yourself. Of course, there are times when Object is useful and times when you have no choice but they are exceptional and should only be done for good reason - not because you haven't taken the time to think of a correct solution.</p> <p>You should also choose better names for your variables and use proper Java naming conventions. Here, I've named the object Thing because your code does not give proper clues as to what dalla, ddira, ddista etc are and how the relate to each other, either in comments or code (which is a bad thing - this code might only ever be seen by you but when you come back in a year, you will wish that you'd done these things).</p> <p>For example:</p> <pre><code>class Thing{ double dalla = 0; double ddira = 0; double ddista = 0; double ddirm = 0; double ddistm = 0; double currentdist = 0; } </code></pre> <p>Then, in your loops or methods or whatever, </p> <pre><code>ArrayList&lt;Thing&gt; things = new ArrayList&lt;Thing&gt;(); ... Thing thing = new Thing(); for (int u = 0; u &lt; accdirtemp.size(); u++) { thing.ddira += Math.pow(accdirtemp.get(u), 2); thing.ddista += Math.pow(accdisttemp.get(u), 2); thing.dalla += Math.pow(accdirtemp.get(u), 2) + Math.pow(accdisttemp.get(u), 2); thing.ddirm += accdirtemp.get(u); thing.ddistm += accdisttemp.get(u); } things.add(thing); ... </code></pre> <p>And so on. Take the time now to refactor your code before it becomes even more of a nightmare to read.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload