我们可以加入nasted功能吗?

编程入门 行业动态 更新时间:2024-10-26 20:21:07
本文介绍了我们可以加入nasted功能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleExample { class Example { public void a() { public void b() { public void c() { Console.WriteLine("abc"); } } static void Main(string[] args) { Example obj = new Example(); obj.a(); } }

我尝试过: 什么是输出如果我定义了一个类并且在类的内部我定义了一个方法a()。在()中,我定义了另一个命名为b()的方法。在b()里面我又定义了一个方法c()。在c()里面我拿了一个语句......所以如果我创建了类的实例并调用了方法a();那么输出将是什么?

What I have tried: what is the Output if i defined a class and inside of the class i defined a method a() . Inside a() i defined one more method naming as b(). and inside b() i defined one more method c(). and inside of c() i took one statement...so that if i created instance of the class and called method a();then what is the output will come

推荐答案

您可以在C#7.0中,但不能在之前的版本中:本地功能(C#编程指南)| Microsoft Docs [ ^ ] You can in C# 7.0, but not in versions before that: Local functions (C# Programming Guide) | Microsoft Docs[^]

更多推荐

我们可以加入nasted功能吗?

本文发布于:2023-10-19 20:28:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1508683.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我们可以   功能   nasted

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!