Time remaining
:
:
Test Status
CSHARPTEST5
Ques 1 :
Which of the following statements are correct about a .NET Assembly?
1. It is the smallest deployable unit.
2. Each assembly has only one entry point - Main(), WinMain() or DLLMain().
3. An assembly can be a Shared assembly or a Private assembly.
4. An assembly can contain only code and data.
5. An assembly is always in the form of an EXE file.
(A) 1, 3, 5
(B) 1, 2, 3
(C) 2, 4, 5
(D) 1, 2
Ques 2 :
Your company uses Visual Studio.NET 2005 as its application development platform. You are developing an application using the .NET Framework 2.0. You are required to use a datatype that will store only numbers ranging from -32,768 to 32,767. Which of the following datatypes will you use to accomplish the task?
(A) short
(B) System.Int16
(C) string
(D) a and b
Ques 3 :
Different ways a method can be overloaded in C#.NET
(A) Different parameter data types
(B) Different order of parameters
(C) Different number of parameters
(D) All of above
Ques 4 :
What is a delegate?
(A) A reference to an object in a different process.
(B) A strongly typed function pointer.
(C) An inter-process message channel.
(D) A light weight thread or process that can call a single method.
Ques 5 :
How does assembly versioning in .NET prevent DLL Hell?
(A) The runtime checks to see that only one version of an assembly is on the machine at any one time.
(B) The compiler offers compile time checking for backward compatibility.
(C) .NET allows assemblies to specify the name AND the version of any assemblies they need to run.
(D) It doesn.t.
Ques 6 :
Which of the following statements is correct about the C#.NET program given below?
namespace PskillsConsoleApplication
{
class Baseclass
{
int i;
public Baseclass(int ii)
{
i = ii;
Console.Write("Base ");
}
}
class Derived : Baseclass
{
public Derived(int ii) : base(ii)
{
Console.Write("Derived ");
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Derived d = new Derived(10);
}
}
}
(A) The program will report an error in the statement base(ii).
(B) The program will work correctly if we replace base(ii) with base.Baseclass(ii).
(C) The program will output: Base Derived
(D) The program will work correctly only if we implement zero-argument constructors in Baseclass as well as Derived class.
Ques 7 :
Which Gang of Four design pattern is shown below?
public class A {
private A instance;
private A() {
}
public
static A Instance {
get
{
if ( A == null )
A = new A();
return instance;
}
}
}
(A) Abstract Factory
(B) Singleton
(C) Builder
(D) Factory
Ques 8 :
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 9 :
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 10 :
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 11 :
When doing an Update, which method of the SqlCommand is best to use?
(A) ExecuteQuery
(B) ExecuteUpdate
(C) ExecuteNonQuery
(D) ExecuteCommand
Ques 12 :
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 13 :
Which of the following statements are correct about static functions?
1. Static functions can access only static data.
2. Static functions cannot call instance functions.
3. It is necessary to initialize static data.
4. Instance functions can call static functions and access static data.
5. This reference is passed to static functions.
(A) 1, 2, 3
(B) 1, 2, 5
(C) 1, 2, 4
(D) 2, 3, 5
Ques 14 :
The company uses Visual Studio .NET as its application development platform. You are creating a strong named MyAssembly that will be used in several applications. The assembly will be rebuilt frequently during the development cycle. You must ensure that every time MyAssembly is rebuilt it works properly with all applications that use it. You are required to configure the computer on which you develop the assembly such that each application uses the latest build of MyAssembly. Which of the following actions will you take to accomplish the task?
(A) Add the following element to the configuration file of every application that uses the assembly
(B) Add the following element to the machine configuration file
(C) To point to the build output directory for the strong named assembly, create a DEVPATH environment variable.
(D) B and C
Ques 15 :
Which of the following statements is correct about constructors?
(A) Static constructors can use optional arguments.
(B) Overloaded constructors cannot use optional arguments.
(C) If we provide a one-argument constructor then the compiler still provides a zero-argument constructor.
(D) If we do not provide a constructor, then the compiler provides a zero-argument constructor.
Ques 16 :
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 17 :
Is it possible to invoke Garbage Collector explicitly?
(A) Yes
(B) No
Ques 18 :
The uniqueId that gets generated at the start of the Session is stored in
(A) Client computer as a cookie
(B) Server machine
(C) Passed to and fro on each and every request and response
(D) Both a and b are correct
Ques 19 :
Which of the following statements are correct about the C#.NET code snippet given below?
class Sample
{
static int i;
int j;
public void proc1()
{
i = 11;
j = 22;
}
public static void proc2()
{
i = 1;
j = 2;
}
static Sample()
{
i = 0;
j = 0;
}
}
(A) j can be initialized in proc2().
(B) i cannot be initialized in proc1().
(C) proc1() can initialize i as well as j.
(D) proc2() can initialize i as well as j.
Ques 20 :
What property is used on the datatable to indicate conflicts after update method is called?
(A) HasCollision
(B) HasErrorConflict
(C) HasError
(D) HasDataError
Submit Answer
Don't Refresh the Page !! ...