Time remaining
:
:
Test Status
CSHARPRANDOMTEST
Ques 1 :
What is ENUM?
(A) It is used to initialize variables
(B) It is used to define constants
(C) It is used to define variables
(D) None
Ques 2 :
Your company uses Visual Studio .NET as its application development platform. You have recently finished development of a class named ShopList using the .NET Framework. The class will include ShopItem objects that have the public properties exhibit below:
1. Name
2. ID
3. DiscountCode
You need to enable users of the class to iterate through the ShopList collection, and to list each product's name and ID using the foreach statement. Which of the following code segments will you use to accomplish this task?
(A) public class ShopList : IEnumerator, IEnumerable { // Class implementation }
(B) public class ShopList : IBindingList { // Class implementation }
(C) public class ShopList : ICollection { // Class implementation }
(D) public class ShopList : IDictionary { // Class implementation }
Ques 3 :
Which of the following are valid .NET CLR JIT performance counters?
1. Total memory used for JIT compilation
2.Average memory used for JIT compilation
3.Number of methods that failed to compile with the standard JIT
4.Percentage of processor time spent performing JIT compilation
5.Percentage of memory currently dedicated for JIT compilation
(A) 1, 2
(B) 1, 5
(C) 3, 4
(D) 4, 5
Ques 4 :
If a method is marked as protected internal who can access it?
(A) Classes within the same assembly, and classes derived from the declaring class.
(B) Internal methods can be only be called using reflection.
(C) Only methods that are in the same class as the method in question.
(D) Classes that are both in the same assembly and derived from the declaring class.
Ques 5 :
Which of the following statements is correct about the C#.NET code snippet given below?
namespace PskillsConsoleApplication
{
class Sample
{
public int func()
{
return 1;
}
public Single func()
{
return 2.4f ;
}
}
class Program
{
static void Main(string[ ] args)
{
Sample s1 = new Sample();
int i;
i = s1.func();
Single j;
j = s1.func();
}
}
}
(A) func() is a valid overloaded function.
(B) func() cannot be considered overloaded because: return value cannot be used to distinguish between two overloaded functions.
(C) Overloading works only in case of subroutines and not in case of functions.
(D) The call j = s1.func() will assign 2.4 to j.
Ques 6 :
In the NUnit test framework, which attribute must adorn a test class in order for it to be picked up by the NUnit GUI?
(A) TestFixtureAttribute
(B) TestClassAttribute
(C) TestAttribute
(D) NUnitTestClassAttribute
Ques 7 :
Which of the following statements is correct?
(A) A constructor can be used to set default values and limit instantiation.
(B) Destructors are used with classes as well as structures.
(C) A class can have more than one destructor.
(D) C# provides a copy constructor.
Ques 8 :
When doing an Update, which method of the SqlCommand is best to use?
(A) ExecuteQuery
(B) ExecuteUpdate
(C) ExecuteNonQuery
(D) ExecuteCommand
Ques 9 :
Which of the following benefits do we get on running managed code under CLR?
1. Type safety of the code running under CLR is assured.
2. It is ensured that an application would not access the memory that it is not
authorized to access.
3. It launches separate process for every application running under it.
4. The resources are Garbage collected.
(A) Only 1, 2 and 4
(B) Only 2, 3 and 4
(C) Only 1 and 2
(D) All of the above
Ques 10 :
Is it possible to invoke Garbage Collector explicitly?
(A) Yes
(B) No
Ques 11 :
What compiler switch creates an xml file from the xml comments in the files in an assembly?
(A) /text
(B) /xml
(C) /doc
(D) /help
Ques 12 :
Which of the following is/are not types of arrays in C#?
(A) Single-Dimensional
(B) Multidimensional
(C) Jazzed arrays
(D) Jagged arrays
Ques 13 :
Automatic paging is possible in
(A) datareader
(B) dataset
(C) datatabel
(D) all
Ques 14 :
Which of the following ways to create an object of the Sample class given below will work correctly?
class Sample
{
int i;
Single j;
double k;
public Sample (int ii, Single jj, double kk)
{
i = ii;
j = jj;
k = kk;
}
}
(A) Sample s3 = new Sample(10, 1.2f, 2.4);
(B) Sample s2 = new Sample(10, 1.2f);
(C) Sample s1 = new Sample(, , 2.5);
(D) Sample s1 = new Sample(10);
Ques 15 :
Which of the following assemblies can be stored in Global Assembly Cache?
(A) Private Assemblies
(B) Shared Assemblies
(C) Protected Assemblies
(D) Friend Assemblies
Ques 16 :
Can we override private virtual methods?
(A) Yes
(B) No
Ques 17 :
Boxing in .Net allows the user to convert
(A) a double type to interger
(B) a interger type to double
(C) a value type to a reference type
(D) a reference type to a value type
Ques 18 :
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?
(A) .NET class libraries
(B) Common Language Infrastructure
(C) Common Language Runtime
(D) Common Type System
Ques 19 :
Which of these is a valid path declaration?
(A) string strPath="c:\\abc.txt";
(B) string strPath=@"c:\abc.txt";
(C) string strPath="c:/abc.txt";
(D) All of these
Ques 20 :
A master page is merged with a content page ________ in the page execution life cycle
(A) Very early
(B) Very late
(C) Early
(D) Late
Submit Answer
Don't Refresh the Page !! ...