Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace StringTheException
- {
- class Program
- {
- static void Main(string[] args)
- {
- string s1 = "immutable";
- string s2 = "immutable";
- Console.WriteLine((s1 == s2)); //True because they are pointing to the same value "immutable"
- Object o1 = new Object();
- Object o2 = new Object();
- Console.WriteLine(o1 == o2); //False because they are pointing at different objects
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement