在C#中使用'final'修饰符 [英] using 'final' modifier in C#

查看:1745
本文介绍了在C#中使用'final'修饰符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

   public      A 
{
私人 无效 show ()
{
最终 字符串 s = "检查" ;
}
}

有人会在上面的代码中使用'final'修饰符吗?

在浏览Q / A博客时找到了这个,它说我们可以在类的方法中声明一个局部变量

是最终的。用户没有解释它的内容尽管如此。

任何帮助都将不胜感激!提前致谢。


解决方案

您需要在更合适的论坛中提出您的问题。 这个仅针对论坛重新设计问题:


http://social.msdn.microsoft.com/Forums/vstudio/en-US/home ?论坛= csharpgeneral


public class A
{
 private void show()
 {
  final String s="checking";
 }
}

Will someone throw some light on the use of ‘final’ modifier in the above piece of code?

Found this while navigating through Q/A blog, where it said that we can declare a local variable

inside a method of a class to be final. The user did not explain much about its use though.

Any help will be much appreciated! Thanks in advance.


解决方案

You need to ask your question in a more appropriate forum.  This one is for Forum Redesign Issues only:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral


这篇关于在C#中使用'final'修饰符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆