#Look at my code I can't figure out what's wrong with my code

1 messages ยท Page 1 of 1 (latest)

toxic pawn
#

i can`t figure out why i have address in my output

craggy boltBOT
#

<@&1004656351647117403> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#

Sure, I'd be happy to help. Please provide me with the code that you are having trouble with so that I can take a look and see if I can identify the issue.

harsh niche
# toxic pawn i can`t figure out why i have address in my output

Your code is so complex for no reason, and there are many weird things, and other things that dont make any sense
But to answer your question, where were you expecting ? If CalculationResult doesn't override toString, it's normal that you get such result

toxic pawn
harsh niche
#

then don't expect to have anything different from this

#

or at least call the correct methods

#
  • DivisionExecutor is totally useless
  • The three StringBuilder in DivisionCalculatorImpl are useless
  • LongDivisionMain extend DivisionCalculatorImpl for no reason
  • CalculationResult doesn't make any sense for several reasons :
    • countDigitMethod doesn't quite count the digits but also do may things ???
    • Why does it return a string if it has side effects on the string builders ?
    • Why is countDigitMethod called method ???
    • Why is this class called a reasult if it does computation, it doesn't make any sense.
    • Why is CalculationResult calling OutputConstructorImpl which itself calls CalculationResult, how does this even make sense ???
  • OutputConstructorImpl has btw, the same problems
  • Next, DivisionCalculatorImpl
    • Why does DivisionCalculatorImpl take the absolute values ? isn't -1/5==-0.2 ?
    • It calls countDigitMethod but doesn't check for the return type ?
    • Why do you return a new CalculationResult which is totally unrelated to the one you just created before ? It is empty and you do nothing of it ?
  • And finally, like I said, you haven't overriden toString nor are calling a method to actually print what you want, so don't expect java to print anything else than ClassName@hashCode since that's what you asked it to print
#

@toxic pawn

#

(I'll go to sleep, so think about this)

toxic pawn
#

thanks. good night