Time remaining
:
:
Test Status
CSHARPRANDOMTEST
Ques 1 :
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 2 :
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 3 :
What does a strong name contain?
(A) publiuc key
(B) assembly name
(C) assembly version
(D) All of the above
Ques 4 :
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 5 :
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 6 :
Which of the following characters ends every C# statement?
(A) Period (.)
(B) Colon (:)
(C) Semicolon (;)
(D) Comma (,)
Ques 7 :
Features of Read only variables
(A) Declaration and initialization is separated
(B) It is allocated at compile time
(C) It is allocated at runtime
(D) all of the above
Ques 8 :
Polymorphism?
(A) Polymorphism means multiple forms and different name
(B) Polymorphism means multiple forms but one name
(C) Polymorphism means single forms and single name
(D) All of the above are true
Ques 9 :
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 10 :
How to kill a user session explicitly?
(A) Session.Discard()
(B) Session.Close()
(C) Session.Abandon()
(D) Session.kill()
Ques 11 :
Difference between Convert.ToString() and ToString()
(A) Convert.ToString() handle null values but ToString() don't
(B) Convert.ToString() only handle null values
(C) ToString() handle null values but Convert.ToString() don't
(D) ToString() output as per format supplied
Ques 12 :
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 13 :
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 14 :
Which of the following in not service model (three-tier application) in c sharp?
(A) Presentation (UI)
(B) Business (logic and underlying code)
(C) Database (for storing the data)
(D) Data (from storage or other sources)
Ques 15 :
Convert vs. Parse methods
(A) Convert converts the value, Parse is for parsing
(B) Convert allows null values, Parse cannot
(C) Both are same
(D) None of these
Ques 16 :
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 17 :
What property is used on the datatable to indicate conflicts after update method is called?
(A) HasCollision
(B) HasErrorConflict
(C) HasError
(D) HasDataError
Ques 18 :
In C#, by default structs are passed how?
(A) By reference.
(B) By value.
(C) By address.
(D) By memory.
Ques 19 :
int keyword targets to which .Net type?
(A) System.Int8
(B) System.Int16
(C) System.Int32
(D) System.Int64
Ques 20 :
Which is true about Interface and abstract methods?
(A) We can write only one abstract method inside interface.
(B) No method is abstract inside interface
(C) All the methods inside Interface in an abstract method.
(D) None of the above
Submit Answer
Don't Refresh the Page !! ...