virtual method

A virtual method is a method that is declared in the base class and is overridden in the derived class. It tells the compiler to perform late binding during runtime. Virtual method allows us to create a list of base class pointers and call methods of any of the derived classes without even knowing the kind of derived class object. 
Virtual method solves the following problem: When a derived class inherits from a base class, an object of the derived class may be referred to via a pointer or reference of the base class type instead of the derived class type. If there are base class methods overridden by the derived class, the method actually called by such a reference or pointer can be bound either 'early' (by the compiler), according to the declared type of the pointer or reference, or 'late' (by the runtime system of the language), according to the actual type of the object is referred to.
Most programming languages, such as Java, JavaScript and Python, treat all methods as virtual by default and do not provide a modifier to change this behaviour.