a) Polymorphism b) Abstraction c) Encapsulation d) Recursion Answer: c Explanation: Encapsulation
View QuestionWhich of these base classes are accessible to the derived class members?
a) static b) protected c) private d) Shared Answer: b Explanation: protected
View QuestionWhich of these is used to access members of class before the object of that class is created?
a) public b) private c) static d) protected Answer: c Explanation: static
View QuestionWhich of these is used as a default specifier for a member of the class if no access specifier is used for it?
a) private b) public c) public, within its own class d) protected Answer: a Explanation: By definition ...
View QuestionHow to print \\ on the screen?
a) Console.WriteLine(“\\”); b) Console.WriteLine(“\\\”); c) Console.WriteLine(“\\\\”); d) Console.WriteLine(“\\\\\\”); Answer: c Explanation: Console.WriteLine(“\\\\”); Output : \\
View QuestionHow is a string typically processed?
a) On a character by character basis b) On a string by string basis c) Both On a ...
View Question
What will be the output of the following C# code snippet?
static void Main(string[] args)
{
string c = “hello”;
string c1 = c.Remove(1);
Console.WriteLine(c1);
Console.ReadLine();
}
What will be the output of the following C# code snippet? static void Main(string[] args) {
View QuestionWhich of these methods of class String is used to extract all the characters from a String object?
a) CHARAT() b) Remove() c) charAt() d) Replace() Answer: b Explanation: Replace() replaces all instances of a ...
View Question
What will be the output of the following C# code snippet?
static void main(String args[])
{
char chars[] = {‘x’, ‘y’, ‘z’};
String s = new String(chars);
Console.WriteLine(s);
}
What will be the output of the following C# code snippet? static void main(String args[]) {
View QuestionWhich of these methods can be used to convert all characters in a String into a character array?
a) CharAt() b) getChars() c) TocharArray() d) All of the mentioned Answer: c Explanation: TocharArray()
View Question