43
Python
7y

Took me longer than I'd like to admit before I realized why my function always returned zero.
Too quick with the constructor it seemed.

Comments
  • 1
    I've made this mistake so many times!

    In my assignment, I had this mistake. Took me ages to figure out the problem.

    Hope I don't make this mistake in next week's sitting/written exam!
  • 6
    @python you are cheating on with Java?

    I didn't expect you to do this. Damn. Shame. Buddy.

    #JustKidding
  • 1
    That's why I always use (when possible) final fields.
  • 4
    Also setting your IDE to underline non initialized properties or not used parameters helps a lot to not miss out on these things.
  • 0
    Use your IDE to generate the constructors.
  • 0
    @Gowtham95india Haha indeed, feeling so guilty about this
Add Comment