2016/6/4

C# sealed vs Java final

FROM:http://stackoverflow.com/questions/10170633/c-sharp-sealed-vs-java-final

回答的很精妙:

That's because final in Java means plenty of different things depending on where you use it whereas sealed in C# applies only to classes.
In Java final can be applied to:
  • classes, which means that the class cannot be inherited. This is the equivalent of C#'s sealed.   

  • methods, which means that the method cannot be overridden in a derived class. This is the default in C#, unless you declare a method as virtual and in a derived class this can be prevented for further derived classes with sealed again.

  • fields and variables, which means that they can only be initialized once. For fields the equivalent in C# is readonly.

沒有留言:

windows 無法拖動文件

原因:未知 症狀:windows點任何文件,都無法拖動到其他地方  解決方式: 來源: https://answers.microsoft.com/en-us/windows/forum/all/drag-and-drop-stopped-working/b73e4938-ca2...