c# print the class name from within a static function

前端 未结 7 789
囚心锁ツ
囚心锁ツ 2021-02-06 23:19

Is it possible to print the class name from within a static function?

e.g ...

public class foo
{

    static void printName()
    {
        // Print the          


        
7条回答
  •  旧时难觅i
    2021-02-06 23:41

    Since static methods cannot be inherited the class name will be known to you when you write the method. Why not just hardcode it?

提交回复
热议问题