1. Correct entry point main method syntax
a. public static void Main(int[] args)
b. public static int Main(string[] args)
c. public static void Main(string[] args)
d.
e.
--------------------------------------------------------------
2.
void main()
{
Try
{
A();
}
Catch()
{
}
}
A()
{
try{B();}
catch()
{
Throw new error();
}
}
B()
{
try{C();}
Catch()
{
}
}
C()
{
throw new exeception....
}
What is the stacktrace
a. B
A
b. C, B, A
c. A, B, C, Main
d. C, B, A, Main
e.
--------------------------------------------------------------
3. Disadvantage of xml serialization
a. cannot serialize public memebers of the class
b. cannot serialize xml node object
c. cannot store type information
d. cannot serialize dataset
e.
--------------------------------------------------------------
4. What is correct statment in case of structures
a. structures cannot impliment interface
b. cannot have public field members
c. cannot have methods
d. cannot have protected members
e.
--------------------------------------------------------------
5. int i = 1;
int j = 1;
console.writeline(i==j);
console.writeline(i.tostring()==j.tostring());
console.writeline((object)i==(object)j);
whtat is the output
a. true, false, true
b. true, true, false
c. true, true, true
d. false, false, false
e. false, true, true
--------------------------------------------------------------
6.
class Csharp
{
static int i = 1;
void main()
{
int i = 5;
multiply(i);
increment(i);
reset();
console.writeline(i);
}
public static void multiply(int i)
{
i *=5;
}
public static void increment(int i)
{
i++;
}
public static void reset()
{
i = 0;
}
}
what is the output
a. 0
b. 5
c. 12
d. 1
e. 6
--------------------------------------------------------------
7. WHICH IS CORRECT IN CASE OF IMPLICIT CONVERSION
a. Double to float
b. sbyte to short
c. char to byte
d. uint to ----
e.
--------------------------------------------------------------
8. Which namespace to be used to get attributes information
a. System.Reflection
b. System.IO;
c. System.Attributes
d.
e.
--------------------------------------------------------------
9. What is nullable type give an exmple with syntax
--------------------------------------------------------------
10. What is friend assembly explain with syntax
--------------------------------------------------------------
11. syntax to allow implicit conversion from int to custom type
a. public static implicit operator TypeA(int arg)
b. public static operator implicit TypeA(int arg)
c. public implicit operator TypeA(int arg)
d. public static implicit TypeA(int arg)
e. public static implicit operator int(TypeA arg)
--------------------------------------------------------------
12. int i = new system.int32
which statement is correct with respect to above code
a. An uninitialized variable of type int is declared.
b. a variable of type int intialized to 0(zero) is declared.
c.
d.
e.
--------------------------------------------------------------
13. int i, j, k =5;
j = 2;
j *= 5;
j=i;
console.writeline(i);
which statement is correct
a. 5
b. 12
c. compile-time error
d. runtime error
e.
--------------------------------------------------------------
14.
class CSharpA
{
Static void main()
{
CSharpA b = new CSharpB();
b.message();
b = new CSharpC();
b.message();
}
public virtual void Message()
{
console.writeline("CSharpA.Message");
}
}
class CSharpB : CSharpA
{
public override void Message()
{
console.writeline("CSharpB.Message");
}
}
class CSharpC : CSharpB
{
public new void Message()
{
console.writeline("CSharpC.Message");
}
}
What is the console output of above code ?
a. CSharpA.Message
CSharpB.Message
b. CSharpB.Message
CSharpB.Message
c. CSharpB.Message
CSharpC.Message
d.
e.
--------------------------------------------------------------
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.