Skip to main content

@override

Overview

The @override tag indicates that a symbol overrides a symbol with the same name in a parent class.

This tag is provided for compatibility with Closure Compiler. By default, JSDoc automatically identifies symbols that override a parent.

If your JSDoc comment includes the @inheritdoc tag, you do not need to include the @override tag. The presence of the @inheritdoc tag implies the presence of the @override tag.

Example

The following example shows how to indicate that a method overrides a method in its parent class:

Method that overrides a parent

/**
* @classdesc Abstract class representing a network connection.
* @class
*/
function Connection() {}

/**
* Open the connection.
*/
Connection.prototype.open = function () {
// ...
}

/**
* @classdesc Class representing a socket connection.
* @class
* @augments Connection
*/
function Socket() {}

/**
* Open the socket.
* @override
*/
Socket.prototype.open = function () {
// ...
}

@inheritdoc