Implemented exception throwing in the method declarations.