Program in C# To Demonstrate Escape Sequences and Verbatim Literal
Program in C# To Demonstrate Escape Sequences and Verbatim Literal
Program in C# To Demonstrate Escape Sequences and Verbatim Literal
Escape Sequence
using System;
class Verbatim {
using System;
class BoxingDemo {
int x;
object obj;
x = 10;
Console.WriteLine(y); }
Boxing
class TestBoxing {
int i = 100;
object o = i;
i = 200;
}
Unboxing
class TestUnboxing {
int i = 100;
object o = i;
// implicit boxing
// attempt to unbox
System.Console.WriteLine("Unboxing OK."); }
catch (System.InvalidCastException e)
}
Program in C# to demonstrate scope of a variable.
using System;
class ScopeDemo {
x = 10;
x = y * 2;