English Reference

Word

virtual method

Definition

compound. a function in computer programming that can be changed or replaced by a more specific version in a later part of the code. It allows a program to decide which version of a task to run while it is actually working.

compound. a member function within a base class that is intended to be overridden by derived classes. It facilitates runtime polymorphism by ensuring that the call to the function is resolved based on the actual type of the object rather than the type of the pointer or reference.

Examples

“The programmer used a virtual method to handle different types of user input.”

“By defining the 'draw' function as a virtual method in the base class, the software can correctly render various shapes at runtime.”

“The implementation of a virtual method typically relies on a dispatch table, allowing the execution environment to perform dynamic binding and execute the most specific subclass implementation available.”

Examples

simple

“The programmer used a virtual method to handle different types of user input.”

contextual

“By defining the 'draw' function as a virtual method in the base class, the software can correctly render various shapes at runtime.”

complex

“The implementation of a virtual method typically relies on a dispatch table, allowing the execution environment to perform dynamic binding and execute the most specific subclass implementation available.”

Usage

Commonly used in object-oriented programming languages like C++, C#, and Java.

Etymology

A compound of virtual, from the Latin virtualis, and method, from the Greek methodos. The term emerged in the late 1960s within the development of the Simula programming language.

Etymology adapted from Wiktionary, available under CC BY-SA 4.0.

Domain

Programming

This entry

Exam level
CambridgeCambridgeCambridge English QualificationsThe exam suite from Cambridge University Press & Assessment, from A1 Movers up to C2 Proficiency. The benchmark names double as CEFR labels.C2 ProficiencyIELTSIELTSInternational English Language Testing SystemThe 0–9 band test co-owned by the British Council, IDP, and Cambridge. Used for university entry, work, and migration.8.5–9.0TOEFL iBTTOEFL iBTTest of English as a Foreign Language, Internet-Based TestETS's academic English test, the standard route for US university admissions. Scored 0–120, with a 1–6 scale since 2026.1–6 scale: 6.0114–120
Level
C2 · Proficiency
Updated

QR code

englishreference.com/q/virtual-method

English Reference