Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace UnderstandingScope
- {
- class Program
- {
- //private static string k = "";
- static void Main(string[] args)
- {
- /*
- string j = "";
- for (int i = 0; i < 12; i++)
- {
- j = i.ToString();
- k = i.ToString();
- Console.WriteLine(i);
- if(i == 9)
- {
- string l = i.ToString();
- }
- //Console.WriteLine(l);
- }
- //Console.WriteLine(i);
- Console.WriteLine("Outside of for loop : "+ j);
- //Console.WriteLine("K = " + k);
- helpermethod();
- */
- Car car = new Car();
- car.DoSomething();
- Console.ReadLine();
- }
- /*
- static void helpermethod()
- {
- Console.WriteLine("K From helpermethod : " + k);
- }
- */
- class Car
- {
- public void DoSomething()
- {
- Console.WriteLine(helperMethod());
- }
- private string helperMethod()
- {
- return "Hello World";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment