What will be the result of a following code execution?
 
using System; 

class App 
{ 
     static void Main() 
     { 
        string s; 
        s+="string"; 
        Console.WriteLine(s); 
    } 
 }
 
Explanation
Variable s is not initialized. If code looked like this
 
string s = "";
s += "string"; 
Cnsole.WriteLine(s);
 
then everything would have been fine, because at least some value is assigned to variable s.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты