I wrote a program that allow two classes to “fight”. For whatever reason C# always wins. What's wrong with VB.NET?

后端 未结 4 1874
眼角桃花
眼角桃花 2020-12-23 13:22

I wrote a program that allow two classes to \"fight\". For whatever reason C# always wins. What\'s wrong with VB.NET ?

   static void Main(string[] args)
            


        
4条回答
  •  半阙折子戏
    2020-12-23 13:45

    By the time the constructor on B completes, both players will have a theoretical value of 100 in their private members.

    However because of the superior internals of C#, the CLI generally considers integers and other primitive values values compiled from that language to be higher, and those from VB.NET to be lower, even when they contain the same bits.

提交回复
热议问题