Mcqs
Mcqs
Mcqs
A. System.Collections
C. Both A and B
D. None of the mentioned
B. System.Collections.Generic
Choose the
System.Text
System.Collections.Generic
System.Linq.Expressions
System.Linq
For the given set of code what is output?
class Program
{
static void Main(string[] args)
{
class Program
{
static void Main(string[] args)
{
int[] nums = { 1, -2, 3, 0, -4, 5 };
var posNums = from n in nums
where n > 0
select n;
int len = posNums.Count();
Console.WriteLine(len);
Console.ReadLine();
}
}
class Program
{
static void Main(string[] args)
{
int[] nums = { 1, -2, 3, 0, -4, 5};
var posNums = from n in nums
where n >= 0
select n;
foreach (int i in posNums)
Console.Write(i + " ");
Console.WriteLine();
Console.ReadLine();
}
}
1, 3, 5
Run time error
0, 1, -2, -4, 5
1, 3, 0, 5
class Program
{
static void Main(string[] args)
{
int[] nums = { 16, 9, 25};
var posNums = from n in nums
where n > 0
select Math.Sqrt(n);
class Program
{
static void Main(string[] args)
{
int[] nums = { 1, -2, 3, 0, -4, 5 };
var posNums = from n in nums
where n > -5 && n < 6
orderby n descending
select n;
Console.Write("Descending order in nums: ");
foreach (int i in posNums) Console.Write(i + " ");
Console.WriteLine();
Console.ReadLine();
}
}
Please read the questions carefully and choose the most appropriate option. Which
of the given options are TRUE about the String Class in C#.NET?
Please read the questions carefully and choose the most appropriate option.Which
of the following components of the .NET framework provide an extensible set of
classes that can be used by any .NET compliant programming language?
1..NET class libraries
2.Component Object Model
only 2
Both 1 and 2
only 1
class test
{
public void print()
{
Console.WriteLine("Csharp:");
}
}
class Program
{
static void Main(string[] args)
{
test t;
t.print();
Console.ReadLine();
}
}
Please read the questions carefully and choose the most appropriate option.Which
of the given options are TRUE?
Please read the questions carefully and choose the most appropriate option.Static
procedures can access instance data? State TRUE or FALSE?
false
true
12
Error as this reference would not be able to call i and j
Error while calling s.fun() due to inaccessible level
class sample
{
public int i;
public int[] arr = new int[10];
public void fun(int i, int val)
{
arr[i] = val;
}
}
class Program
{
static void Main(string[] args)
{
sample s = new sample();
s.i = 10;
sample.fun(1, 5);
s.fun(1, 5);
Console.ReadLine();
}
}
Please read the questions carefully and choose the most appropriate option.Which
of the given options CANNOT be a target for custom attribute?
Event
Namespace
Delegate
All the listed options
}
class Program
{
static void Main(string[] args)
{
sample s = new sample();
s.i = 10;
sample.fun(1, 5);
s.fun(1, 5);
Console.ReadLine();
}
}
Console.WriteLine(1);
if (Convert.ToBoolean(x >> 1))
continue;
}while (Convert.ToBoolean(0));
break;
}
Console.ReadLine();
}
0 0 0.infinite times
System outofflow exception error.
1 1 1 1 1 1 :ans
1 1 1.infinite times
It finds reverse of i
It finds binary equivalent of i
It finds sum of digits of i
It finds octal equivalent of i
{
num += 20;
Console.WriteLine(num);
}
1
1
1
1
11
21
21
11
21
1
21
21
21
21
21
21
0
24
0
32
0
0
0
0
32
0
0
0
24
0
32
0
0
0
0
0
32
0
0
0
Please read the questions carefully and choose the most appropriate option.Which
of the given options are TRUE?
1.A switch statement can act on numerical as well as Boolean types.
2.A switch statement can act on characters, strings and enumerations types.
60
48
64
120
{
int a = 10, b = 20;
method(ref a, ref b);
console.writeline(a + " " + b);
}
static void swap(ref int i, ref int j)
{
int t;
t = i;
i = j;
j = t;
}
Call by reference
Call by value
parameter arrays
Output parameter
}
}
class Output
{
static void Main(String[] args)
{
maths obj = new maths();
Console.WriteLine(obj.fact(1));
Console.ReadLine();
}
}
1
10
2
0
Please read the questions carefully and choose the most appropriate option.An
enum that is declared inside a class, struct, namespace or interface is treated as
public. State True or False.
false
true
Console.WriteLine(s);
Console.ReadLine();
}
}
c
a
abc
b
class Program
{
static void Main(string[] args)
{
String s1 = "Hello i love Csharp";
StringBuilder s2 = new StringBuilder(s1);
Console.WriteLine(s1.Equals(s2));
Console.ReadLine();
}
}
Compile time error
true
False
0
enum per
{
a,
b,
c,
d,
}
per.a = 10;
Console.writeline(per.b);
2
11
Compile time error
1
void func(int x)
{
}
void fun(param int[] x)
{
Please read the questions carefully and choose the most appropriate option.Which
of the given options are TRUE about enumerators?
1.The value of each successive enumerator is decreased by 1.
2.Values of enum elements cannot be populated from a database.
Ixgo
Ixig
Ixigo
Ixigo
Please read the questions carefully and choose the most appropriate option.What is
the size of a Decimal data type?
32 byte
4 byte
16 byte
8 byte
f, e, d, c, b
b, c, d, e, f
Access specifiers
What will be size of object created depicted by csharp code snippet?
class baseclass
{
private int a;
protected int b;
public int c;
}
class derived : baseclass
{
private int x;
protected int y;
public int z;
}
class Program
{
static Void Main(string[] args)
{
derived a = new derived();
}
}
20 bytes
24 bytes
16 bytes
12 bytes
What will be the output of given code snippet?
class access
{
public int x;
private int y;
public void cal(int a, int b)
{
x = a + 1;
y = b;
}
}
class Program
{
static void Main(string[] args)
{
9, 10
3, 2
5, 9
6, 9
What will be the output of following set of code?
class static_out
{
public static int x;
public static int y;
public int add(int a, int b)
{
x = a + b;
y = x + b;
return 0;
}
}
class Program
{
static void Main(string[] args)
66
77
79
97
What will be the output of following set of code?
class sum
{
public int x;
private int y;
public void math(int a, int b)
{
x = a * 4;
y = b;
}
}
class Program
{
static void Main(string[] args)
{
sum p = new sum();
p.math(12, 30);
Console.WriteLine(p.x + " " + p.y);
Console.ReadLine();
}
}
0, 0
48, 0
48, 30
Compile time error
40, 12
5, 40
10, 20
20, 10
class test
{
public int a;
public int b;
}
class Program
{
static void Main(string[] args)
{
test obj = new test(10, 20);
obj.meth(obj);
Console.WriteLine(obj.a + " " + obj.b);
Console.ReadLine();
}
}
40, 20
10, 20
20, 40
20, 10
Which of these is used as default specifier for a member of class if no access specifier is used for it?
protected
public, within its own class
private
public
Basics
Choose the class on which all stream classes are defined?
Sytem.Input.stream
System.Output.stream
System.IO.stream
A method used to write a single byte to an output stream?
Read()
write()
void WriteByte(byte value)
int Write(byte[] buffer ,int offset ,int count)
Please read the questions carefully and choose the most appropriate option.Which of the given options are
1.The attributes applied can be read from an assembly using Reflection class.
2.An attribute can have parameters.
only 1
None of the listed options
Both 1 and 2
only 2
Please read the questions carefully and choose the most appropriate option.Which of the given options are
1.Arrays can be rectangular or jagged.
2.Rectangular arrays have similar rows stored in adjacent memory locations.
None of the listed options
only 2
only 1
Both 1 and 2
Please read the questions carefully and choose the most appropriate option.Read the below statements ca
Statement 1: Managed code is the code that is compiled by the JIT compilers.
Statement 2: Managed code is the code where resources are Garbage Collected.
Which of the above statements are TRUE about Managed Code?
All statements are true
Please read the questions carefully and choose the most appropriate option.Read the below statements ca
Statement 1: CLR provides services to run "managed" applications.
Statement 2: The resources are garbage collected.
Statement 3: CLR provides services to run "unmanaged" applications.
Which of the following statements are TRUE about the .NET CLR?
Choose the filemode method which is used to create a new output file with condition that file with same na
FileMode.OpenOrCreate
FileMode.Truncate
FileMode.Create
FileMode.CreateNew
Please read the questions carefully and choose the most appropriate option.Which of the given options are
1.By position
2.By name
only 1
only 2
Both 1 and 2
None of the listed options
Which among is used for storage of memory aspects?
BufferedStream
Class
Please read the questions carefully and choose the most appropriate option.Which of the given options are
Please read the questions carefully and choose the most appropriate option.With which of the given optio
1.Static data
2.Instance data
only 1
only 2
Both 1 and 2
None of the listed options
Please read the questions carefully and choose the most appropriate option.Which of the given options ar
public int i;
public int j;
public void fun(int i, int j)
{
this.i = i;
this.j = j;
}
}
class Program
{
static void Main(string[] args)
{
sample s = new sample();
s.i = 1;
s.j = 2;
s.fun(s.i, s.j);
Console.WriteLine(s.i + " " + s.j);
Console.ReadLine();
}
}
Error as this reference would not be able to call i and j
Run successfully but prints nothing
Error while calling s.fun() due to inaccessible level
12
Select the output for following set of code :
class z
{
public string name1;
public string address;
public void show()
{
Console.WriteLine("{0} is in {1}", name1, address);
}
}
class Program
{
static void Main(string[] args)
{
z n = new z();
n.name1 = "harsh";
n.address = "new delhi";
n.show();
Console.ReadLine();
}
}
Run successfully prints nothing
Syntax error
Please read the questions carefully and choose the most appropriate option.The string built using the String
StringBuilder class are mutable. State TRUE or FALSE.
true
false
Select the output for following set of code :
class sample
{
public int i;
public int j;
public void fun(int i, int j)
{
this.i = i;
this.j = j;
}
}
class Program
{
static void Main(string[] args)
{
sample s = new sample();
s.i = 1;
s.j = 2;
s.fun(s.i, s.j);
Console.WriteLine(s.i + " " + s.j);
Console.ReadLine();
}
}
Error while calling s.fun() due to inaccessible level
Run successfully but prints nothing
Error as this reference would not be able to call i and j
12
Select output for following set of code.
class sample
{
public int i;
public int[] arr = new int[10];
public void fun(int i, int val)
{
arr[i] = val;
}
}
class Program
{
static void Main(string[] args)
{
sample s = new sample();
s.i = 10;
sample.fun(1, 5);
s.fun(1, 5);
Console.ReadLine();
}
}
sample.fun(1, 5) will set value as 5 in arr[1]
s.fun(1, 5) will work correctly
sample.fun(1, 5) will not work correctly
s.i = 10 cannot work as i is public
The output of code is ?
class test
{
public void print()
{
Console.WriteLine("Csharp:");
}
}
class Program
{
static void Main(string[] args)
{
test t;
t.print();
Console.ReadLine();
}
}
None of the mentioned
Code run and print Csharp
Code run successfully print nothing
Syntax error as t is unassigned variable which is never used
Select the output for following set of code :
class z
{
public int X;
public int Y;
public const int c1 = 5;
public const int c2 = c1 * 25;
public void set(int a, int b)
{
X = a;
Y = b;
}
}
class Program
{
static void Main(string[] args)
{
z s = new z();
s.set(10, 20);
Console.WriteLine(s.X + " " + s.Y);
Console.WriteLine(z.c1 + " " + z.c2);
Console.ReadLine();
}
}
20 10
20 10
10 20
10 20
5 125
What do the following code implies ?
csharp abc;
abc = new csharp();
Object creation on class csharp
Please read the questions carefully and choose the most appropriate option.Static procedures can access in
true
false
Please read the questions carefully and choose the most appropriate option.Which of the following components of the .NET framework
language?
1..NET class libraries
2.Component Object Model
only 2
Both 1 and 2
None of the listed options
only 1
Console
false
0
1
I/O EXCEPTION ERROR
Choose the output returned when error condition generates while read() reads from the console.
0
-1
false
All the given options
Which among the following methods used writes characters to a string?
StringWriter
StreamReader
StreamWriter
None
Select the correct input methods provided by Console?
ReadLine()
ReadKey(), ReadLine()
Read(), ReadLine()
Read(), ReadLine(), ReadKey()
Which method in Console enables to read individual inputs directly from the keyboard in a non line buffere
ReadKey()
ReadLine()
All the given options
Read()
Which of these method used to read string from the console?
readLine()
read()
get()
getline()
Which of these method/methods used to read block or array of bytes from the file?
ReadByte()
Read()
Readkey()
ReadLine()
Choose the object of TextReader class.
Console.In
Console.Error
None
Console.Out
Choose the output return when read() reads the character from the console?
Boolean
String
Char
Integer
SystemInputException
InterruptedException
I/O Exception
SystemException
Which of these methods are used to read single character from the console?
a) get()
b) getline()
c) read()
d) readLine()
Console
false
0
1
I/O EXCEPTION ERROR
Choose the output returned when error condition generates while read() reads from the console.
0
-1
false
All the given options
Which among the following methods used writes characters to a string?
StringWriter
StreamReader
StreamWriter
None
Select the correct input methods provided by Console?
ReadLine()
ReadKey(), ReadLine()
Read(), ReadLine()
Which method in Console enables to read individual inputs directly from the keyboard in a non line buffere
ReadKey()
ReadLine()
All the given options
Read()
Which of these method used to read string from the console?
readLine()
read()
get()
getline()
Which of these method/methods used to read block or array of bytes from the file?
ReadByte()
Read()
Readkey()
ReadLine()
Choose the object of TextReader class.
Console.In
Console.Error
None
Console.Out
ReadKey
WriteKey
ReadLine
WriteLine
Choose the output return when read() reads the character from the console?
Boolean
String
Char
Integer
Run successfully ask for input and hence display the results
Compile time error
Run successfully donot prints anything
Syntax Error
What would be the output for following input from the console as a character?
static void Main(string[] args)
{
Console.WriteLine("what is your name?");
char s;
s = Convert.ToChar(Console.ReadLine());
SystemInputException
InterruptedException
I/O Exception
SystemException
Which of these methods are used to read single character from the console?
a) get()
b) getline()
c) read()
d) readLine()
Constructor
Please read the questions carefully and choose the most appropriate option.Which of given options is TRUE
class maths
{
int i;
public maths(int x)
{
i = x;
Console.WriteLine("hello:");
}
}
class maths1 : maths
{
public maths1(int x) :base(x)
{
Console.WriteLine("bye");
}
}
class Program
{
static void Main(string[] args)
{
maths1 k = new maths1(12);
Console.ReadLine();
}
}
bye
12
hello:
bye
12
hello
Compile time error
What will be the output of given set of code?
class maths
{
public int length;
public int breadth;
public maths(int x)
{
length = x + 1;
}
public maths(int x, int y)
{
length = x + 2;
}
}
class Program
{
144.0
60
24
60
144
60
0
What will be the output of given set of code?
class maths
{
static maths()
{
int s = 8;
Console.WriteLine(s);
}
public maths(int f)
{
int h = 10;
Console.WriteLine(h);
}
}
class Program
{
static void Main(string[] args)
{
maths p = new maths(0);
Console.ReadLine();
}
}
int i;
public maths(int ii)
{
ii = -25;
int g;
g = ii > 0 ? ii : ii * -1;
Console.WriteLine(g);
}
}
class maths1 :maths
{
public maths1(int ll) :base(ll)
{
ll = -1000;
Console.WriteLine((ll > 0 ? ll : ll * -1));
}
}
class Program
{
static void Main(string[] args)
{
maths1 p = new maths1(6);
Console.ReadLine();
}
}
-1025
25
1000
-1025
None of mentioned
What will be the output of given set of code?
class maths
{
public maths()
{
Console.WriteLine("constructor 1 :");
}
public maths(int x)
{
int p = 2;
int u;
u = p + x;
Console.WriteLine("constructor 2: " +u);
}
}
class Program
{
constructor 1:
constructor 2: 6
None of the mentioned
constructor 2: 6
constructor 2: 6
constructor 2: 6
constructor 1:
What will be the output of given set of code?
class maths
{
int i;
public maths(int ii)
{
ii = 12;
int j = 12;
int r = ii * j;
Console.WriteLine(r);
}
}
class maths1 : maths
{
public maths1(int u) :base(u)
{
u = 13;
int h = 13;
Console.WriteLine(u + h);
}
}
class maths2 : maths1
{
public maths2(int k) :base(k)
{
k = 24;
int o = 6 ;
Console.WriteLine(k /o);
}
}
class Program
{
Please read the questions carefully and choose the most appropriate option.How many times can a construc
Only once
As many times as we call it
Twice
Any number of times before the object gets garbage collected.
Correct statements about constructor overloading in C# is?
Overloaded constructors have same name as the class name
Overloaded constructors can use optional arguments
Overloaded constructors can have different type of number of arguements as well as differ in numbe
All the given options
Control structures
Select the output for following set of code :
static void Main(string[] args)
{
int x = 0;
do
{
x++;
if (x == 5)
{
x++;
continue;
break;
}
Console.WriteLine(x + " ");
}while (x < 10);
}
10
5 6 7 8 9 10
12345
1 2 3 4 7 8 9 10
Select output for following set of code :
111
000
True True True
False False False
Please read the questions carefully and choose the most appropriate option.Which of the given options are
1.The goto statement passes control to the next iteration of the enclosing iteration statement in which it a
2.Branching is performed using jump statements which cause an immediate transfer of the program contro
Both 1 and 2
None of the listed options
only 2
only 1
What is output for following code snippet?
class Program
{
static void Main(string[] args)
{
int i = 5;
int j;
method1(ref i);
method2(out j);
Console.WriteLine(i + " " + j);
}
static void method1(ref int x)
{
x = x + x;
}
static void method2(out int x)
{
x = 6;
x = x * x;
}
}
36 10
10 36
00
36 0
}
Console.WriteLine("\n");
i = 0;
while ( ++i < 5)
{
Console.WriteLine(i);
}
Console.ReadLine();
}
12345
1234
123
1234
1234
12345
12345
12345
Select the output for following set of code :
static void Main(string[] args)
{
int x;
for (x = 1; x <= 3; x++)
{
int j = 1;
do
{
j++;
}while (x % j == 2);
Console.WriteLine(x + " " + j);
}
Console.ReadLine();
}
11
12
13
11
21
31
11
12
13
12
22
32
Which of these data types is used by operating system to manage the Recursion in Csharp?
Array
Tree
Stack
Queue
Select output for following set of code :
int n = 1;
method(n);
Console.WriteLine(n);
method1(ref n);
Console.WriteLine(n);
Console.ReadLine();
}
static void method(int num)
{
num += 20;
Console.WriteLine(num);
}
static void method1(ref int num)
{
num += 20;
Console.WriteLine(num);
}
do
{
Console.WriteLine(x % 10);
}while ((x = x / 10) != 0);
Console.ReadLine();
}
enter x = 1234.
0.05
-0.05
-0.04999995
0.95
}
c++;
}
Console.ReadLine();
}
for x = 8.
Execute while 2 time
Execute while 3 time
Execute while 4 time
Execute while 5 time
Execute while 2 time
Execute while 4 time
Execute while 6 time
Execute while 8 time
Execute while 1 time
Execute while 2 time
Execute while 3 time
Execute while 4 time
Execute while 5 time
Execute while 6 time
Execute while 7 time
Execute while 1 time
Execute while 3 time
Execute while 5 time
Execute while 7 time
Select the output for following set of code:
static void Main(string[] args)
{
float s = 0.1f;
while (s <= 0.5f)
{
++s;
Console.WriteLine(s);
}
Console.ReadLine();
}
Please read the questions carefully and choose the most appropriate option.Which of the given options can
1.break
2.goto
only 1
Both 1 and 2
None of the listed options
only 2
Which of these is not a correct statement?
Recursive methods are faster that programmers written loop to call the function repeatedly using a
A recursive method must have a base case
Recursion is a process of defining a method that calls other methods which in turn call again this m
Recursion is a process of defining a method that calls itself repeatedly
Recursion another form of class
Recursion another process of defining a method that calls other methods repeatedly
Select the output for following set of Code:
static void Main(string[] args)
{
int i;
i = 0;
while (i++ < 5)
{
Console.WriteLine(i);
}
Console.WriteLine("\n");
i = 0;
while ( ++i < 5)
{
Console.WriteLine(i);
}
Console.ReadLine();
}
123
1234
12345
1234
1234
12345
12345
12345
Select output for following set of code :
111
000
True True True
False False False
Select the output for following set of Code:
static void Main(string[] args)
{
int x = 0;
while (x < 20)
{
while (x < 10)
{
if (x % 2 == 0)
{
Console.WriteLine(x);
}
x++;
}
}
Console.ReadLine();
}
02468
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
0 2 4 6 8 10
0 2 4 6 8 10 12 14 16 18 20
aData types
Please read the questions carefully and choose the most appropriate option.Which of the given options are
1.The value of each successive enumerator is decreased by 1.
2.Values of enum elements cannot be populated from a database.
None of the listed options
only 1
only 2
Both 1 and 2
{
red,
black,
pink
}
static void Main(string[] args)
{
colors s = colors.black;
Type t;
t = s.GetType();
string[] str;
str = Enum.GetNames(t);
Console.WriteLine(str[0]);
Console.ReadLine();
}
black
0
red
1
Which of these method of class String is used to check whether a given string starts with a particular substr
Ends()
StartsWith()
Starts()
EndsWith()
What will be the output of give code snippet?
class Program
{
static void Main(string[] args)
{
String s1 = "Hello i love Csharp";
StringBuilder s2 = new StringBuilder(s1);
Console.WriteLine(s1.Equals(s2));
Console.ReadLine();
}
}
Compile time error
true
False
0
Please read the questions carefully and choose the most appropriate option.Which of the given options are TRUE about enumerators?
1.Anenum variable can be defined inside a class or a namespace.
2.Anenum variable cannot have a protected access modifier.
only 1
None of the listed options
only 2
Both 1 and 2
Please read the questions carefully and choose the most appropriate option.Which of the given options are
A String is created on the stack.
A String is created on the heap.
A String is a primitive.
None of the given options
Choose the correct output for given set of code?
enum per
{
a,
b,
c,
d,
}
per.a = 10;
Console.writeline(per.b);
2
Compile time error
1
11
Choose the correct output for given set of code?
enumcolor:int
{
red,
green,
blue = 5,
cyan,
pink = 10,
brown
}
static void Main(string[] args)
{
Console.WriteLine((int)color.green);
Console.WriteLine((int)color.brown);
}
1 11
15
2 10
2 11
4, 6, 10, 12, 5
3, 4, 7, 8, 5
Compile time error
3, 4, 7, 8, 5, 1, 2, 3, 4, 5
Data types
Please read the questions carefully and choose the most appropriate option.Which of the given options are
please read the questions carefully and choose the most appropriate option.Which of the given data types
long
int
byte
short
var
out
Choose the correct output for given set of code?
enum per
{
a,
b,
c,
d,
}
per.a = 10;
Console.writeline(per.b);
2
11
Compile time error
1
What will be the output of given set of code?
static void Main(string[] args)
{
int[] x = { 80, 82, 65, 72, 83, 67 };
fun(x);
Console.ReadLine();
}
static void fun(paramsint [] b )
{
inti;
for (i = 5; i>=0 ; i--)
{
Console.WriteLine(Convert.ToChar(b[i]));
}
}
67 83 72 65 82 80
80 82 65 72 83 67
CSHARP
PRAHSC
Which of these method of class String is used to check whether a given string starts with a particular substr
EndsWith()
Starts()
StartsWith()
Ends()
Choose correct statement about the C#.NET code given below?
enumcolor:byte
{
yellow = 500,
green = 1000,
pink = 1300
}
bytes value cannot be assigned to enum elements
As valid range of byte exceeded the compiler will report an error
enum elements should always take successive values
enum must always be of int type
Please read the questions carefully and choose the most appropriate option.Which of the given options are
1.String literals can contain any character literal including escape sequences.
2.Attempting to access a character that is outside the bounds of the string results in an IndexOutOfRangeE
Both 1 and 2
only 2
only 1
None of the listed options
hat will be the output for given set of code ?
static void Main(string[] args)
{
object[] a = {"1", 4.0f, "harsh"};
fun(a);
Console.ReadLine();
}
static void fun(params object[] b)
{
for (inti = 0; i<b.Length - 1; i++)
Console.WriteLine(b[i] + " ");
}
1
4.0
harsh
1
4
harsh
1
4
hars
1
4
What will be the output of set of code?
static void Main(string[] args)
{
int [] a = {1, 2, 3, 4, 5};
fun(a);
Console.ReadLine();
}
static void fun(paramsint[] b )
{
int[] k = { 3, 4, 7, 8,'\0' };
for (inti = 0; i<b.Length; i++)
{
b[i] = b[i] + k[i] ;
Console.WriteLine( b[i] + " ");
}
}
4, 6, 10, 12, 5
3, 4, 7, 8, 5
Compile time error
3, 4, 7, 8, 5, 1, 2, 3, 4, 5
Correct output for the C#.NET code given below is?
enum letters
{
a,
b,
c
}
static void Main(string[] args)
{
letters l;
l = letters.a;
Console.WriteLine(l);
Console.ReadLine();
}
0
a
-1
letters.a
Please read the questions carefully and choose the most appropriate option.Which of the
given options are TRUE?
1.A variable cannot be assigned to an enum element.
2.An enumerator contains white space in its name.
only 1
None of the listed options
only 2
Both 1 and 2
Please read the questions carefully and choose the most appropriate option.Which of the given options are
1.An implicit cast is needed to convert from enum type to an integral type.
2.Anenum variable cannot have a public access modifier.
only 1
only 2
None of the listed options
Both 1 and 2
DEBUG
If debug point is on a methodcall,______will execute the entire method at a time and stops at the nextline
StepOut
Break
Step over
Step In
hat is the shortcut key that is used to Start or resume execution of your code and then halts execution wh
Ctrl-F5
Ctrl-F9
Ctrl-F10
Ctrl-Shift-F5
What is the shortcut key that is used to execute remaining lines out from procedure?
Shift-F5
Shift-F11
F11
F5
What is the shortcut key that is used to set the execution point to the line of code you choose
Ctrl-Shift-F5
Ctrl-F5
Ctrl-F10
Ctrl-Shift-F10
What is the shortcut key that is used to execute the next line of code but doesnot step into any function ca
session?
Shift-F9
Shift-F10
Shift-F5
Shift-F11
What is the shortcut key that is used to set or removes breakpoint at the current line?
F5
F6
F10
F9
What is the shortcut key that is used to allow you to attach or detach the debugger to one or more runnin
Ctrl-Alt-H
Ctrl-Alt-P
Ctrl-Alt-W
Ctrl-Alt-D
What is the shortcut key that is used to run the code without invoking debugger?
F9
F10
Ctrl-F5
F5
What is the shortcut key that is used to display the threads window to view all of the threads
for the current process?
Ctrl-Alt-P
Ctrl-Alt-D
Ctrl-Alt-W
Ctrl-Alt-H
what are the commands that are not available in break mode to proceed for further debugging
StepIn
StepOut
Continue
Break
GARBAGE COLLECTIONS
30
0
180
Compile time error
Select the output for following set of Code :
static void Main(string[] args)
{
int a = 5, b = 10;
if (Convert.ToBoolean(Convert.ToInt32(0xB)))
if (Convert.ToBoolean(Convert.ToInt32(022)))
if (Convert.ToBoolean(Convert.ToInt32('\xeb')))
Console.WriteLine("java");
else ;
else ;
else ;
}
java
Compile time error: Undefined symbol
Compile time error: Misplaced else
Warning: Condition is always true
Select output for set of code :
static void Main(string[] args)
{
int []a = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
func(ref a);
Console.ReadLine();
}
static void func(ref int[] x)
{
Console.WriteLine(" numbers are:");
for (inti = 0; i<x.Length; i++)
{
if (x[i] % 2 == 0)
{
x[i] = x[i] + 1;
Console.WriteLine(x[i]);
}
}
}
numbers are : 3 5 7 9 11
None of the mentioned
numbers are : 2 3 4 5 6
numbers are : 2 4 6 8 10
Select the output for following set of code :
static void Main(string[] args)
{
int x = 8;
int b = 16;
int C = 64;
x /= b /= C;
Console.WriteLine(x + " " + b+ " " +C);
Console.ReadLine();
}
8 2 32
Run time error
32 4 8
32 2 8
Select correct output for following set of code.
static void Main(string[] args)
{
int X = 0;
if (Convert.ToBoolean(X = 0))
Console.WriteLine("It is zero");
else
Console.WriteLine("It is not zero");
Console.ReadLine();
}
if ((num % 2) == 0)
{
even += 1;
}
else
{
odd += 1;
}
if(num[i] % 2 == 0)
{
even += 1;
}
else
{
odd += 1;
}
if((num * i) == 0)
{
even += 1;
}
else
{
odd += 1;
}
if(num[i] % 2 = 0)
{
even += 1;
}
else
{
odd += 1;
}
Select the ouput for following set of code :
static void Main(string[] args)
{
int x = 4 ,b = 2;
x -= b/= x * b;
Console.WriteLine(x + " " + b);
Console.ReadLine();
}
40
04
42
None of mentioned
010
001
010
100
Please read the questions carefully and choose the most appropriate option.
Which of the following jobs are NOT performed by Garbage Collector?
All the listed options
Closing unclosed database collections.
Freeing memory on the stack.
Closing unclosed files.
Please read the questions carefully and choose the most appropriate option.Imagine the scenario below.
On pushing a button an object is to be notified, but it is not known until runtime which object should be no
Which of the given programming constructs should be used to implement this idea?
Namespace
Interface
Delegate
Attribute
Select the output for following set of Code :
static void Main(string[] args)
{
int a = -1;
int b = -1;
if (Convert.ToBoolean (++a = ++b))
Console.WriteLine("a");
else
Console.WriteLine("b");
Console.ReadLine();
}
b
a
compile time error
Code execute successfully with no output
{
get
{
return num1;
}
set
{
num1 = value;
}
}
public int anumber1
{
get
{
return num2;
}
set
{
num2 = value;
}
}
}
class Program
{
public static void Main(string[] args)
{
number p = new number();
p.anumber = 20;
number k = new number();
k.anumber1 = 40;
int m = p.anumber;
int t = k.anumber1;
int r = p.anumber + k.anumber1;
Console.WriteLine("number = " +m);
Console.WriteLine("number = " +t);
Console.WriteLine("sum = " +r);
Console.ReadLine();
}
}
None
sum = 60
number = 40
number = 20
number = 20
number = 40
sum = 60
Linq
Assume 2 columns named as Product and Category how can be both sorted out based on first by category
select n;
foreach (int i in posNums)
Console.Write(i + " ");
Console.WriteLine();
Console.ReadLine();
}
1, 3, 0, 5
0, 1, -2, -4, 5
1, 3, 5
Run time error
System.Linq
System.Text
System.Linq.Expressions
System.Collections.Generic
For the given set of code which query will work according to the set of code?
class Program
{
static void Main(string[] args)
{
int[] nums = { 1, -2, 3, 0, -4, 5 };
int len = /*_________________ */
Console.WriteLine("The number of positive values in nums: " + len);
Console.ReadLine();
}
}
select n;
Console.Write("Descending order in nums: ");
foreach (int i in posNums) Console.Write(i + " ");
Console.WriteLine();
Console.ReadLine();
}
}
Print nothing code run successfully
Run time error
Compile time error
Arranged in descending order code run successfully
Select the namespace which should be included while making use of LINQ operations
System.Collections.Generic
None of the mentioned
System.Text
System.Linq
10 2 -4 -6
5 1 -2 -3
Run time error
1 5 -2 -3
Opps 4\
What is output following set of code ?
using System;
public class BaseClass
{
public BaseClass()
{
Console.WriteLine("I am a base class");
}
}
public class ChildClass : BaseClass
{
public ChildClass()
{
Console.WriteLine ("I am a child class");
}
static void Main()
{
ChildClass CC = new ChildClass();
}
}
Please read the questions carefully and choose the most appropriate option.Which of the given statements
Please read the questions carefully and choose the most appropriate option.Which of the given statements
A class that implements an interface can explicitly implement members of that interface
An interface can be implemented by multiple classes in the same program.
One interface can be implemented in another interface
The functions declared in an interface have a body
please read the questions carefully and choose the most appropriate option.Which of the given statements
Please read the questions carefully and choose the most appropriate option.Which of the given statements
1.One class can implement only one interface.
2.In a program if one class implements an interface then no other class in the same program can impleme
Only 1
None of the listed options
Only 2
Both 1 and 2
Correct statement about following C#.NET code is?
class baseclass
{
int a;
public baseclass(int a1)
{
a = a1;
Console.WriteLine("a");
}
class derivedclass : baseclass
{
public derivedclass(int a1)
: base(a1)
{
Console.WriteLine("b");
}
}
class program
{
static void Main(string[] args)
{
derivedclass d = new derivedclass(20);
}
}
}
Output : b
a
the program will work correctly if we replace base(a1) with base.baseclass(a1)
Output : a
b
Compile time error
Select the output for given set of code?
public class sample
{
public static int x = 100;
public static int y = 150;
}
public class newspaper :sample
{
new public static int x = 1000;
static void Main(string[] args)
{
console.writeline(sample.x + " " + sample.y + " " + x);
}
}
Please read the questions carefully and choose the most appropriate option.Which of the given statements
1.Interfaces can contain only method declaration.
2.Interfaces can contain static data and methods.
only 2
None of the listed options
Both 1 and 2
only 1
Please read the questions carefully and choose the most appropriate option.
It is possible to create a custom attribute that can be applied only to specific programming element(s)
like which of the given options?
Classes
Methods
Classes, Methods and Member-Variables
Classes and Methods
Please read the questions carefully and choose the most appropriate option.Which of the given statements
1.One class can implement only one interface.
2.In a program if one class implements an interface then no other class in the same program can impleme
Only 2
None of the listed options
Both 1 and 2
Only 1
Which statement should be added in function a() of class y to get output i love csharp?
class x
{
public void a()
{
Console.WriteLine("i love csharp");
}
}
class y : x
{
public void a()
{
/* add statement here */
Console.Write("bye");
}
}
class program
{
static void Main(string[] args)
{
y obj = new y();
obj.a();
}
}
a()
x.a();
x::a();
base.a();
Please read the questions carefully and choose the most appropriate option.Which of the given options can
1.Events
2.Structures
None of the listed options
only 2
Both 1 and 2
only 1
Please read the questions carefully and choose the most appropriate option.Which of the given statements
To implement an interface member, the corresponding member in the class must be public as well a
Please read the questions carefully and choose the most appropriate option.Which of the given options can
1.Properties
2.Method
Both 1 and 2
None of the listed options
only 1
only 2
Please read the questions carefully and choose the most appropriate option.Which of the given options can
1.class
2.enum
Both 1 and 2
only 1
None of the listed options
only 2
Select statement added to the current set of code to get output as 10 20 ?
class baseclass
{
protected int a = 20;
}
class derived : baseclass
{
int a = 10;
public void math()
{
/* add code here */
}
}
Console.WriteLine(a + + base.a);
Console.WriteLine( mybase.a + + a);
Console.WriteLine(base.a + + a);
Console.WriteLine( a + + this.a);
Oops 5
A class consists of two interfaces with each interface consisting of three methods.
The class had no instance data which indicates correct size of object created from this class?
12 bytes
16 bytes
0 bytes
24 bytes
Which of these statements is incorrect?
Two thread in Csharp can have same priority
Creating an instantiation for a thread doesn't mean that thread has started its execution process
By multithreading CPUs idle time is minimized, and we can take maximum use of it
A thread can exist only in two states, running and blocked
Which of these class is used to make a thread?
String
System
Runnable
Thread
The modifier used to define a class which does not have objects of its own but acts as a base class for its
abstract
Static
New
Sealed
Given the class sample inherited by class sample 1. Which are correct statements about
construction of object of class sample?
The constructor of only sample class will be called
While creating the object firstly the constructor of class sample will be called followed by constructor
While creating the object firstly constructor of class sample 1 will be called followed by constructor of
The order of calling constructors depend on whether constructors in class sample and sample 1 are p
void f1();
void f2();
}
class a :a1
{
private int i;
void a1.f1()
{
}
}
Compile time error
Class a could not have an instance data
Class a is an abstract class
Class a fully implements the interface a1
What is multithreaded programming?
Its a process in which a single process can access information from many sources
Its a process in which two different processes run simultaneously
Its a process in which two or more parts of same process run simultaneously
Its a process in which many different process are able to access same information
Which of the following is the correct way of implementing an interface addition by class
maths?
a) class maths : addition {}
b) class maths implements addition {}
c) class maths imports addition {}
d) None of the mentioned
Select the output for following set of codes:
static void Main(string[] args)
{
int i = 0;
while (i++ != 0) ;
Console.WriteLine(i);
Console.ReadLine();
}
1
0 to 127
A class member declared protected becomes member of subclass of which type?
private member
public member
static member
protected member
Select the output for following set of code:
static void Main(string[] args)
{
int i = 1, j = 1;
while (++i <= 10)
{
j++;
}
Console.WriteLine(i+ " " +j);
Console.ReadLine();
}
It is not necessary to declare size of an array with its type
11 10
12 11
00
41
14
22
Oops 6
Correct way to implement the interface given below?
interface person
{
string firstname
{
get;
set;
}
}
class emp :person{ private string str; public string firstname; { get { return str; } set { str = value;
class emp :implements person { private string str; public string firstname { get { return str; } set {
None of the mentioned
class emp: implements person { private string str; public string person.firstname { get { return str;
Correct code to be added for overloaded operator for C# .net code given below?
class csharp
{
int x, y, z;
public csharp()
{
}
public csharp(int a ,int b ,int c)
{
x = a;
y = b;
z = c;
}
Add correct set of code here
public void display()
{
console.WriteLine(x + " " + y + " " + z);
}
class program
{
static void Main(String[] args)
{
csharp s1 = new csharp(5 ,6 ,8);
csharp s3 = new csharp();
s3 = - s1;
s3.display();
}
}
}
public static csharp operator -(csharp s1) { csharp t = new csharp(); t.x = s1.x; t.y = s1.y; t.z = s1
public static csharp operator -(csharp s1) { csharp t = new csharp(); t.x = -s1.x; t.y = -s1.y; t.z =
public static csharp operator -(csharp s1) { csharp t = new csharp(); t.x = s1.x; t.y = s1.y; t.z = -s
None of the mentioned
public maths()
{
this.x = 0;
this.y = 0;
}
}
class Program
{
static void Main(string[] args)
{
mathsobj = new maths();
int a = 4;
double b = 3.5;
obj.add(a, a);
obj.add(b, b);
Console.WriteLine(obj.x + " " + obj.y);
Console.ReadLine();
}
}
7.5 8
80
87
4 3.5
What will be the output of given code snippet?
interface calc
{
void cal(inti);
}
public class maths :calc
{
public int x;
public void cal(inti)
{
x = i * i;
}
}
class Program
{
public static void Main(string[] args)
{
mathsarr = new maths();
arr.x = 0;
arr.cal(2);
Console.WriteLine(arr.x);
Console.ReadLine();
}
}
0
2
4
None of the mentioned
What could be the output of following set of code?
class Program
{
static void Main(string[] args)
{
Console.WriteLine( vol(10));
Console.WriteLine( vol(2.5f, 5));
Console.WriteLine( vol( 5l, 4, 5));
Console.ReadLine();
}
static intvol(int x)
{
return(x * x * x);
}
static float vol(float r, int h)
{
return(3.14f * r * r * h);
}
static long vol(long l, int b, int h)
{
return(l * b * h);
}
}
1000 0 100
0 0 100
compile time error
1000 98.125 100
What will be the output for given set of code?
class maths
{
public int fun(int ii)
{
return(ii > 0 ? ii :ii * -1);
}
public long fun(long ll)
{
return(ll> 0 ? ll :ll * -1);
}
}
class Program
{
static void Main(string[] args)
{
mathsobj = new maths();
inti = -25;
int j ;
long l = -100000l ;
long m;
double d = -12.34;
double e;
j = obj.fun(i);
m = obj.fun(l);
e = obj.fun(d);
Console.WriteLine(j + " " + m + " " + e);
Console.ReadLine();
}
}
000
111
0
25 100000 12.34
Select the correct implementation of the interface which is mentioned below.
interface a1
{
int fun(inti);
}
public inti;
void display()
{
Console.WriteLine(i);
}
}
class sample1 : sample
{
public int j;
public void display()
{
Console.WriteLine(j);
}
}
class Program
{
static void Main(string[] args)
{
sample1 obj = new sample1();
obj.i = 1;
obj.j = 2;
obj.display();
Console.ReadLine();
}
}
1
2
3
Compile Time Error
The following set of code run on single level of inheritance. Find correct statement about the code?
class sample
{
inti = 10;
int j = 20;
public void display()
{
Console.WriteLine("base method ");
}
}
class sample1 : sample
{
public int s = 30;
}
class Program
{
static void Main(string[] args)
{
sample1 obj = new sample1();
Console.WriteLine("{0}, {1}, {2}", obj.i, obj.j, obj.s);
obj.display();
Console.ReadLine();
}
}
Oops concept 1
Which of these can be used to fully abstract a class from its implementation?
Packages
Objects
None of the Mentioned
Interfaces
Access specifiers which can be used for an interface?
Private
All of the mentioned
Protected
Public
Does C#.NET supports partial implementation of interfaces?
true
Cant Say
false
Which of following keyword used to change data and behaviour of a base class by replacing a member of a
new derived member?
Overrides
new
Base
Overloads
Which keyword used for correct implementation of an interface in C#.NET?
intf
Interface
Intf
interface
Correct statement about C# code is?
public class maths
{
public int x;
public virtual void a()
{
}
}
public class subject : maths
{
new public void a()
{
}
}
The subject class version of a() method gets called using sample class reference which holds subjec
synchronized
synchronize
synch
syn
Which statement correctly defines about Interfaces in C#.NET?
Oops concept 2
Please read the questions carefully and choose the most appropriate option.Which of the given options are
C# does not support multiple inheritance in case of classes, but interfaces do support multiple inhe
In an interface all the methods are abstract.
All of the listed options
All interfaces should be declared with the keyword interface.
Please read the questions carefully and choose the most appropriate option.Which of the given options are
Multiple classes may implement the same interface, and a single class may implement one or more
Interfaces are essentially definitions of how a class needs to respond.
In interface at least one method should not be abstract.
Please read the questions carefully and choose the most appropriate option.Is it possible to implement an
Yes, but you should provide signatures of all methods, in the derived class
No, there is a limit to the number of interfaces you can implement in a single derived class
Yes, and you may or may not provide signature of all methods, in the derived class
Until the call of which type of method the newly created thread will not start executing?
New()
Start()
All the given options
Begin()
Please read the questions carefully and choose the most appropriate option.Which of the given options are
We can use override keyword to change the implementation of the virtual methods in the sub class
Please read the questions carefully and choose the most appropriate option.Which of the given options are
Please read the questions carefully and choose the most appropriate option.Read the below statement care
Statement 1: An interface in C# is a pure abstract class
Statement 2: An interface contains only definition of events, indexers, methods and/or properties.
Which of the above statements is TRUE about "Interfaces"?
Please read the questions carefully and choose the most appropriate option..
Which of the given options is TRUE about "Interfaces"?
Classes and structs inheriting interfaces must provide an implementation for each interface member
Classes and structs inheriting interfaces, may or may not provide an implementation for each interfa
Please read the questions carefully and choose the most appropriate option.Inheritance enables you to cre
are defined in other classes?
Please read the questions carefully and choose the most appropriate option.If you add a new method to an Interface, then which of the g
You have the option of providing default implementation and therefore all the existing code might wo
You have to track down all the implementations of the interface and define implementation for the ne
None of the 2 listed options
Which statement correctly defines about Interfaces in C#.NET?
None
Please read the questions carefully and choose the most appropriate option.Read the below statements care
Statement 1: Interface requires more time to find the actual method in the corresponding classes where as
Statement 2: Abstract method declarations are only permitted in abstract classes.
Which of the above statements are TRUE?
Only Statement 2 is true
Both statements are true
No Statement is true
Only Statement 1 is true
Choose the correct statement about following code snippet in C#.NET:
interface abc
{
String FirstName
{
get;
set;
}
String LastName
{
get;
set;
}
void print();
void stock();
int fun();
}
Properties cannot be declared inside an interface
None of the mentioned
Functions should be declared inside an interface
It is workable code
Until the call of which type of method the newly created thread will not start executing?
New()
Begin()
All the given options
Start()
Choose the namespace which supports the multithreading programming:
All of the mentioned
System.net
System.Linq
System.Threading
Oops concept 3
Please read the questions carefully and choose the most appropriate option.Which of the given options are
Both the override method and the virtual method must have the same access level modifier.
An abstract method is implicitly a virtual method.
The overridden base method must be virtual, abstract or override.
All the listed options
Please read the questions carefully and choose the most appropriate option.Which of the given options is TRUE?
When overriding a method, the names and type signatures of the override method must be the same
None of the 2 listed options
Abstract methods are implicitly virtual.
Both the listed options
What will be the output for given set of code?
class A
{
public virtual void display()
{
Console.WriteLine("A");
}
}
class B: A
{
public override void display()
{
Console.WriteLine("B");
}
}
class Program
{
static void Main(string[] args)
{
A obj1 = new A();
B obj2 = new B();
A r;
r = obj1;
r.display();
r = obj2;
r.display();
Console.ReadLine();
}
}
A
B
Compile time error
B
B
A
A
Please read the questions carefully and choose the most appropriate option.Which of the
given options is TRUE?
None of the 2 listed options
Both the listed options
When used as a modifier, the new keyword explicitly hides a member inherited from a base class.
Operator overloading works in different ways for structures and classes.
Please read the questions carefully and choose the most appropriate option.Which of the given options is T
25 0
216 0
Compile time error
216 25
Please read the questions carefully and choose the most appropriate option.In which of the following shou
methods?
Number of arguments
Order of arguments
Type of arguments
All the listed options
Please read the questions carefully and choose the most appropriate option.Which of the given options is T
We can use the new modifier to modify a nested type if the nested type is hiding another type.
None of the 2 listed options
Both the listed options
Operator overloading permits the use of symbols to represent computations for a type.
Please read the questions carefully and choose the most appropriate option.Which of the following keyword
functions?
operator
All the listed options
op
opoverload
Please read the questions carefully and choose the most appropriate option.Which of the given options is TRUE?
Operator overloading works in different ways for structures and classes.
Both the listed options
Please read the questions carefully and choose the most appropriate option.A derived class can stop virtua
not inheritable
extends
sealed
inheritable
Please read the questions carefully and choose the most appropriate option.Which of the given options is TRUE?
When a binary operator is overloaded the corresponding assignment operator, if any, must be explic
Please read the questions carefully and choose the most appropriate option.Which of the given options are
&&
All the listed options
!
||
What will be the output for given set of code?
class a
{
public void fun()
{
Console.WriteLine("base method");
}
}
class b: a
{
public new void fun()
{
Console.WriteLine("derived method");
}
}
class Program
{
static void Main(string[] args)
{
b k = new b();
k.fun();
Console.ReadLine();
}
}
Compile time error
derived method
base method
Code run successfully print nothing
What will be the output for given set of code?
class maths
{
public int fun(int k, int y)
{
return k + y;
}
public int fun1(int t, float z)
{
return (t+(int)z);
}
}
class Program
{
static void Main(string[] args)
{
mathsobj = new maths();
inti;
int b = 90;
int c = 100;
int d = 12;
float l = 14.78f;
i = obj.fun(b, c);
Console.WriteLine(i);
int j = (obj.fun1(d, l));
Console.WriteLine(j);
Console.ReadLine();
}
}
190, 0
190, 26.78f
190, 26
0, 26.78f
What will be the output for given set of code?
class a
{
public void fun()
{
Console.WriteLine("base method");
}
}
class b: a
{
public new void fun()
{
Console.WriteLine("derived method");
}
}
class Program
{
static void Main(string[] args)
{
b k = new b();
k.fun();
Console.ReadLine();
}
}
derived method
Compile time error
base method
Code run successfully print nothing
Please read the questions carefully and choose the most appropriate option.Which of the given options can
Events
Methods
Properties
All the listed options
Please read the questions carefully and choose the most appropriate option.Which of the given options is T
88
8 10
78
02
Please read the questions carefully and choose the most appropriate option.Which of the given options is T
Please read the questions carefully and choose the most appropriate option.Which of the given options is T
When overriding a method, the names and type signatures of the override method must be the same
Properties
choose the correct statement about properties describing the indexers?
None
class math
{
public int add
{
set
{
add = value;
}
}
}
class math
{
int ad;
public int add
{
get
{
return ad;
}
set
{
ad = value;
}
}
}
class math
{
int ad;
public int add
{
set
{
ad = value;
}
}
}
Select the modifiers which can be used with the properties?
All the given options
Protected Internal
Private
Public
Protected
Choose the correct statements about write-only properties in C#.NET?
Properties which can only be set
All of the listed options
Properties once set and hence values cannot be read back in nature
Useful for usage in classes which store sensitive information like password of a user
Consider a class maths and we had a property called as sum.b is a reference to a maths object and
we want the statement Console.WriteLine(b.sum)to fail.
Which is the correct solution to ensure this functionality?
Declare sum property with only get accessor
Declare sum property with get, set and normal accessors
Declare sum property with both get and set accessors
None
class math
{
public int add
{
get
{
return ad;
}
}
}
class math
{
int ad;
public int add
{
get
{
return ad;
}
set
{
ad = value;
}
}
}
class math
{
int ad;
public int add
{
get
{
return ad;
}
}
Consider a class maths and we had a property called as sum.b is a reference to a maths object and we wa
functionality?
b.maths = 10;
Console.WriteLine(b.maths);
Please read the questions carefully and choose the most appropriate option.A property can be declared ins
false
true
[A].
True
[B].
False
Reflections
Which one of the following is an example of serialization
All the given options
SOAP
Session
Database
Diskfile
Which objects services multiple clients and hence it share data by storing state information between client
Singleton
Single Call
Multiton
Multi Call
What does the following code specifies?
object Invoke(object obj, object[] parameters)
Calling a type using invoke()
Any arguments that need to be passed to the method are specified in the array parameters
All the given options
The value returned by the invoked method is returned by Invoke()
The property signifies Obtains a Module object that represents the module (an executable file) in which th
specifies the following statement:
int MetadataToken
Type DeclaringType
Type ReflectedType
Module Module
Choose the namespace which consists of classes that are part of .NET Reflection API:
None
System.Name
System.Text
System.Reflection
How many types of serialization that are commonly used ?
object to byte
byte to array
object to array
byte to object
Which Serialization is used for communicating between application that uses heterogeneous architectures
Soap Serialization
All the given options
XML Serialization
Binary Serialization
Xml
With XML:
views are not limited to one multi-valued path only
database data can automatically be extracted from XML documents only.
All the given options
documents can automatically be generated from database data only.