Можно ли запретить наследование от какого-то класса?
Да, можно. Для того, чтобы запретить наследоваться от класса необходимо объявить его с модификатором sealed.
Например, если мы не хотим чтобы от класса SomeClass можно было наследоваться, то объявляем его так:
sealed class SomeClass { // Объявление класса }
В качестве альтернативы, можно запретить и создание экземпляров этого класса с помощью ключевого слова static (под капотом, будет использована пара модификаторов: abstract sealed).
static class Helper { // допустимы лишь статические методы }
Можно ли запретить наследование от какого-то класса?
Да, можно. Для того, чтобы запретить наследоваться от класса необходимо объявить его с модификатором sealed.
Например, если мы не хотим чтобы от класса SomeClass можно было наследоваться, то объявляем его так:
sealed class SomeClass { // Объявление класса }
В качестве альтернативы, можно запретить и создание экземпляров этого класса с помощью ключевого слова static (под капотом, будет использована пара модификаторов: abstract sealed).
static class Helper { // допустимы лишь статические методы }
Telegram is a cloud-based instant messaging service that has been making rounds as a popular option for those who wish to keep their messages secure. Telegram boasts a collection of different features, but it’s best known for its ability to secure messages and media by encrypting them during transit; this prevents third-parties from snooping on messages easily. Let’s take a look at what Telegram can do and why you might want to use it.
The SSE was the first modern stock exchange to open in China, with trading commencing in 1990. It has now grown to become the largest stock exchange in Asia and the third-largest in the world by market capitalization, which stood at RMB 50.6 trillion (US$7.8 trillion) as of September 2021. Stocks (both A-shares and B-shares), bonds, funds, and derivatives are traded on the exchange. The SEE has two trading boards, the Main Board and the Science and Technology Innovation Board, the latter more commonly known as the STAR Market. The Main Board mainly hosts large, well-established Chinese companies and lists both A-shares and B-shares.