What will be the result of the 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 be fine, because at least some value is assigned to variable s.
C#
C# Quiz
Learn C# Online

or Read more about C# Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback