---
title: "Discussion on \"C#中是否可以继承String类?\" | Hashnode"
description: "Discussion on \"C#中是否可以继承String类?\". C#中是否可以继承String类?\n答：String类是sealed类故不可以继承。\n当对一个类应用 sealed 修饰符时，此修饰符会阻止其他类从该类继承。 在下面的示例中，类 HoverTree 从类 Keleyi 继承，但是任何类都不能从类 HoverTree 继承。\nclass Keleyi {} \nsealed class HoverTree : Keleyi {}\n还可以在重写基类中的虚方法或虚属性的方法或属性上使用 sealed 修饰符。 这将使您能够允许类从您的类继承，并防止它们..."
url: "https://hashnode.com/posts/cstring/658e757582fadba13996a447"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [C#中是否可以继承String类?](https://blog.robinjiang.com/cstring?utm_source=hashnode&utm_medium=feed)

C#中是否可以继承String类? 答：String类是sealed类故不可以继承。 当对一个类应用 sealed 修饰符时，此修饰符会阻止其他类从该类继承。 在下面的示例中，类 HoverTree 从类 Keleyi 继承，但是任何类都不能从类 HoverTree 继承。 class Keleyi {} sealed class HoverTree : Keleyi {} 还可以在重写基类中的虚方法或虚属性的方法或属性上使用 sealed 修饰符。 这将使您能够允许类从您的类继承，并防止它们...

Apr 13, 2020 · 1 min read · blog.robinjiang.com  
Read the article

## Written by

[robin Jiang](https://hashnode.com/@robinj)

@robinj · SHENZHEN,CN

  
[View profile](https://hashnode.com/@robinj)

Geek,Agile

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
