Skip to content
Advertisement

Chained Hashing Program; the method is undefined for the type error

I have made multiple methods, and they all have the error called

JavaScript

and there is another problem that is

JavaScript

Why are the methods undefined? Is there something wrong with the class?

Or is there something wrong in someplace I am ignorant about.

adding code and the class with methods underneath.

code ChainHashEx :

JavaScript

class ChainHash :

JavaScript

Advertisement

Answer

your ChainHash methods are defined inside the Node class, that’s why they can’t be found.

I think it’s a “braces” error:

  • add a } after

    JavaScript

    to “end” the Node class;

  • remove a } at the bottom of ChainHash;

  • remove void from the ChainHash constructor.

after these fixes the code should compile.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement