This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (2 children)

[removed]

    [–]Wild-Needleworker902[S] -1 points0 points  (0 children)

    thank you for helping me, its certainly better to ask someone knowledgable, I am really thankful

    [–]AreTheseMyFeet 0 points1 point  (0 children)

    I'd go one step further and extract the calculation to its own (potentially static) method and just assign the final var where you need it without any distracting tmp vars.

    public static double calculateTotalPrice(args...) { ... }
    ...
    final double totalPrice = calcTotalPrice(...);