Advertisement
areyesram

Untitled

Sep 17th, 2020
1,755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Nested
  4. {
  5.     internal class Program
  6.     {
  7.         private static void Main()
  8.         {
  9.             new Greeting("Alex").Run();
  10.         }
  11.  
  12.         private sealed class Greeting
  13.         {
  14.             private readonly string name;
  15.  
  16.             internal Greeting(string name)
  17.             {
  18.                 this.name = name;
  19.             }
  20.  
  21.             internal void Run()
  22.             {
  23.                 Helper.Say(name);
  24.             }
  25.  
  26.             private static class Helper
  27.             {
  28.                 internal static void Say(string name)
  29.                 {
  30.                     Console.WriteLine("Hello, " + name);
  31.                 }
  32.             }
  33.         }
  34.     }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement