Why does the second method not work. - C#