---
title: "Why is the virtual keyword used in code?"  
description: "Why is the virtual keyword used in code?"  
author: "Johnny Depp"  
published: 2013-11-12  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/1816/why-is-the-virtual-keyword-used-in-code  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Why is the virtual keyword used in code?

The Virtual keyword is used in code to define methods and the properties that can be overridden in derived classes.

## Answers

### Answer by Johnny Depp

The Virtual keyword is used in code to define methods and the properties that can be overridden in derived classes.


---

Original Source: https://www.mindstick.com/interview/1816/why-is-the-virtual-keyword-used-in-code

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
