What will be the output of the following C# code?
static void Main(string[] args)
{
String obj = "hello";
String obj1 = "world";
String obj2 = obj;
string s = obj + " " + obj1;
Console.WriteLine(s.Substring(6 ,5));
Console.ReadLine();
}
static void Main(string[] args)
{
String obj = "hello";
String obj1 = "world";
String obj2 = obj;
string s = obj + " " + obj1;
Console.WriteLine(s.Substring(6 ,5));
Console.ReadLine();
}
A. hello
B. orld
C. world
D. o world
Answer: Option C
Join The Discussion