Implemented the constructor, destructor and the getNumItems method.