SHARE
TWEET

Untitled

a guest Oct 17th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace constants
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int a = 10;
  10.             //The variable b is a constant and can't be changed after being assigned.
  11.             const int b = 15;
  12.  
  13.             a = 5;
  14.             //If we try this we will get an exception.
  15.             //b = 10;
  16.  
  17.             Console.WriteLine("a: " + a + " b:" + b);
  18.             Console.ReadLine();
  19.         }
  20.     }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top