Click here to Skip to main content
15,910,009 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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();  
     }
   
}


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
Posted
Updated 24-Oct-17 8:06am
v2
Comments
Pankaj hyderabad 24-Oct-17 13:50pm    
answer me plz...

1 solution

You can in C# 7.0, but not in versions before that: Local functions (C# Programming Guide) | Microsoft Docs[^]
 
Share this answer
 
Comments
Pankaj hyderabad 24-Oct-17 14:18pm    
can u provide me that code
Maciej Los 24-Oct-17 14:35pm    
OMG! Please follow the link. There's piece of code you may try to use.
OriginalGriff 24-Oct-17 14:36pm    
Remind you of any discussions?

https://www.codeproject.com/Messages/5447723/Copy-Paste-Coding-Culture.aspx

:sigh:
Pankaj hyderabad 24-Oct-17 14:47pm    
okay
Pankaj hyderabad 24-Oct-17 14:55pm    
where is code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900