Q161
Open questionDid method use to remove whitespace from the string?
Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
170
Questions
9/9
Page
Pick an option on a question to see the right answer and solution.
Q161
Open questionSelect an option to see the answer and solution.
Q162
Open questionSelect an option to see the answer and solution.
Q163
Open questionSelect an option to see the answer and solution.
Q164
Open questionSelect an option to see the answer and solution.
Q165
Open questionclass A
{
int i;
int j;
public A()
{
i = 1;
j = 2;
}
}
class Program
{
static void Main(string[] args)
{
A obj1 = new A();
Console.WriteLine(obj1.ToString());
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q166
Open questionclass access
{
public int x;
private int y;
public void cal(int a, int b)
{
x = a + 1;
y = b;
}
public void print()
{
Console.WriteLine(" " + y);
}
}
class Program
{
static void Main(string[] args)
{
access obj = new access();
obj.cal(2, 3);
Console.WriteLine(obj.x);
obj.print();
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q167
Open questionstatic void Main(string[] args)
{
string s = " i love you";
Console.WriteLine(s.IndexOf('l') + " " + s.lastIndexOf('o') + " " + s.IndexOf('e'));
Console.ReadLine();
}Select an option to see the answer and solution.
Q168
Open questionclass Program
{
static void Main(string[] args)
{
String s1 = "CSHARP";
String s2 = s1.Replace('H','L');
Console.WriteLine(s2);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q169
Open questionSelect an option to see the answer and solution.
Q170
Open questionclass MyClass
{
char[] chrs = { 'A', 'B', 'C', 'D' };
public System.Collections.IEnumerator GetEnumerator()
{
foreach (char ch in chrs)
yield return ch;
}
}
class Program
{
static void Main(string[] args)
{
MyClass mc = new MyClass();
foreach (char ch in mc)
Console.Write(ch + " ");
Console.WriteLine();
Console.ReadLine();
}
}Select an option to see the answer and solution.