Time remaining
:
:
Test Status
CSHARPRANDOMTEST
Ques 1 :
When doing an Update, which method of the SqlCommand is best to use?
(A) ExecuteQuery
(B) ExecuteUpdate
(C) ExecuteNonQuery
(D) ExecuteCommand
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 :
How can we sort the elements of the array in descending order?
(A) By calling Sortdescending() method
(B) By calling Sort() method
(C) By calling Sort() and then Reverse() methods
(D) By calling Sortreverse() method
Ques 4 :
Can an Interface be instantiated directly?
(A) Yes
(B) No
Ques 5 :
Are private class-level variables can inherited?
(A) Yes, and we can access them
(B) No, and we can not access them
(C) Yes, but we can not access them
(D) All of the above are wrong
Ques 6 :
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 7 :
What is a satellite Assembly?
(A) A peripheral assembly designed to monitor permissions requests from an application.
(B) An assembly containing localized resources for another assembly.
(C) An assembly designed to alter the appearance or .skin. of an application.
(D) Any DLL file used by an EXE file.
Ques 8 :
Which of the following characters ends every C# statement?
(A) Period (.)
(B) Colon (:)
(C) Semicolon (;)
(D) Comma (,)
Ques 9 :
If a class is using an interface, it must
(A) contain the same methods as the interface
(B) inherit the properties of the interface
(C) create an interface object
(D) all of the above
Ques 10 :
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 11 :
What is boxing?
(A) Encapsulating a value type in an object.
(B) Encapsulating an object in a value type.
(C) Encapsulating a copy of a value type in an object.
(D) Encapsulating a copy of an object in a value type.
Ques 12 :
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 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 :
What does a strong name contain?
(A) publiuc key
(B) assembly name
(C) assembly version
(D) All of the above
Ques 15 :
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 16 :
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 17 :
Which of the following .NET components can be used to remove unused references from the managed heap?
(A) Class Loader
(B) Garbage Collector
(C) CTS
(D) CLR
Ques 18 :
What is the output of the code public class B : A { }
(A) It defines a class that inherits the public methods of A only.
(B) It defines a class that inherits all the methods of A but the private members cannot be accessed.
(C) Errors
(D) a and b
Ques 19 :
A class that cannot be inherited is what type of class?
(A) Sealed
(B) Gather
(C) Static
(D) Constru
Ques 20 :
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.
Submit Answer
Don't Refresh the Page !! ...