Olete.in
Articles
Mock Tests
🧪 .NET Micro Framework MCQ Quiz Hub
.NET MCQ Set 2
Choose a topic to test your knowledge and improve your .NET Micro Framework skills
1. Which of the following is not a component of the .NET framework?
Common Language Specification
JVM
Metadata and Assemblies
Windows Forms
2. In C#, which type of variable is declared inside a method?
Serial
Private
Static
Local
3. In the body of a method, which variable does C# use to refer to the current object whose method is being invoked?
that
do
this
call
4. In the ASP.NET server control, which provides an alternative way of displaying text on web page?
< asp:label >
< asp:button >
< asp:listitem >
None of These
5. In C#, which of the following describes a local variable?
Can be used anywhere in the program
Must accept a class
Represents a class object
Declared within a method
6. In C#, which of the following is the proper header for a class that intends to use an interface?
class MyClass ; Iface
class MyClass : Iface
class MyClass {IFace}
class MyClass Iface
7. In which of the following GC Collection mode does the garbage collector determine whether the current time is optimal to reclaim objects?
Forced
Optimized
Concurrent
Parallel
8. Where are the String class and Char structure found?
System namespace
System.Text namespace
System.Strings namespace
System.Chars namespace
9. Which of the following defines a delegate?
A means of passing arrays into methods
A class that encapsulates methods
A Washington representative
A substitue for an inherited method
10. Which of the following describes what this code snippet implies? namespace TestApplication { class HelloWorld {} }
TestApplication class contains the class HelloWorld
TestApplication class contains the namespace HelloWorld
TestApplication namespace contains the class HelloWorld
Compilation error
11. Which type of block encloses code that could throw an exception?
Exception
Catch
Try
Error
12. In C#, which code converts a string to lowercase?
string.ToLower();
string.ToLower(string);
ToLower(string);
String = string.ToLower(string);
13. In C#, which of the following is created from this code? class Test: Form { }
The class Test that inherits the class Form
The class Test : Form
The class Test : Form and the class Test that inherits the class Form
The class Form that inherits the class Test
14. In ASP.NET, which of the following is the extension of a web user control file?
.asmx
.ascx
ashx
aspx
15. Which of the following defines synchronization?
Delay a thread until there is sufficient memory and work to keep it up
Ensure that two concurrently-executing threads or processes do not execute specific portions of a program at the same time
Make every thread start and end at the same time
Make every thread do the same thing
16. In C#, which of the following does this code create? String mystring;
A class and a constructor
A class
A constructor
An object
17. Which of the following actions does an abstract class create?
May extend another class
All of these
May contain constructors
May contain instance variables
18. Which of the following .NET framework classes can be used for Custom Parallel Partitioning ?
ConcurrentBag<T>
OrderablePartitioner<TSource>
ConcurrentQueue<T>
BlockingCollection<T> Class
19. Which of the following is not contained in the ThreadPriority enumeration?
Lowest
ThreadPriority enumeration contains all of these.
Belownormal
Highest
20. Which of the following exceptions is thrown when a member/class lookup results in more than one member/class matching the lookup criteria?
FileNotFoundException
System.Reflection.AmbiguousMatchException
AppDomain.UnhandledException
FormatException
21. In which of the following Generations does the CLR allocate memory for new objects?
Generation 3
Generation 0
Generation 1
Generation 2
22. Which type of code is the following? public class A { IEmailSender _emailSender public A(IEmailSender emailSender) { _emailSender = emailSender; } private void SendEmail() { _emailSender.Send(); } }
Inheritance
Dependency injection
Tightly coupled classes
Method overloading
23. In C#, which of the following describes two StringBuilder objects that contain the same string?
They are two different objects
All of these
They represent the same memory location
They are both changed when a change is made to either
24. Your Web application, ABCWebApp1, is configured to use Windows Authentication. After granting a specific group NTFS permissions to access a specific file named ABC.doc, you need to ensure that users not belonging to this group cannot access the file. Which of the following should you include to ensure unauthorized access?
Configure the machine.config file to include the <authentication mode="[None]"> element
Configure the Web.config file to include the <identity impersonate="true"/> element
Configure the app.config file to include the <authentication mode="[None]"> element
Configure the machine.config file to include the <identity impersonate="true"/> element
25. Which of the following often results in an event?
Not an object type
Code used to force a user action
The result of a party
The result of a user action
26. Which of the following is the first event to be triggered in an .aspx page?
Page.Load
Page.PreRender
Page.PreRender
None of these
27. How do string indexers treat strings?
Arrays of characters
1 to string length
A character
Binary code
28. Which of the following is a valid syntax of entry point for all C# programs?
Static void Main(string[] args)
static Main(string[] args)
static void Main(string[] args)
static Main(string args)
29. In C#, which of the following is used to define two methods in a single class with the same name but with different sets of argument types?
Multiplexing
Overriding
Overloading
Duplexing
30. Which action will occur when a method detects that a problem has occurred?
The method will catch an exception.
The method will try and catch an exception.
The method will throw an exception.
The method will try an exception.
31. Which class are exception objects derived from?
System
Exception
Catch
Event
32. In C#, which of the following is used to return a thread from a suspended state?
Resume
Restart
Interrupt
Pulse
33. Which of the following is used to create a string literal exclude escape sequence?
$string
!string
#string
@string
34. In C#, which of the following is an instance variable?
Represents an attribute of an object
Is a method of a class
Is an object of a class
Is both an object of a class and a method of a class
35. Which methods are used to lock and unlock an object?
Enter and Exit
Lock and Unlock
Close and Allow
Close and Open
36. Which of the following is the correct way to define a namespace alias in VB.NET?
Using MyNamespace = MyComponent.Web.UI.WebControls;
Using MyComponent.Web.UI.WebControls as MyNamespace;
Using MyComponent.Web.UI.WebControls = MyNamespace;/div>
None of These
37. In ASP.NET, which of the following describes IsPostBack?
Method of the System.UI.Web.Page class
Method of the System.Web.UI.Page class
Read-only property of the System.Web.UI.Page class
None of these
38. In ASP.NET, to add a custom control to a Web form, it is necessary to register with which of the following?
TagPrefix
Assemblyname
The namespace of the .dll that is referenced
All of these
39. Which of the following does BCL stand for?
Bass Class Language
Binary Class Language
Binary Common Libraries
Base Class Libraries
40. In ASP.NET, which control does not have any visible interface?
Repeater
Datagrid
Datalist
DropdownList
41. In C#, which class is extended by every class directly or indirectly?
System
Drawing
Console
Object
42. Which method should you consider using in order to develop an application that meets the following requirements? • A different ASPX page is displayed when the application's original URL is entered • After the page executes, the original URL is not visible to users • A single client browser request is sufficient for the execution of a page
HttpContext.Current.RewritePath
HttpContext.Current.RemapHandler
HttpContext.Current.ToString
HttpContext.Current.GetType
43. How is concatenation of strings done?
Operator overloading
Reserved words
Method calls
Operator overloading and method calls
44. In ASP.NET, which class is used to derive custom controls?
System.Web.UI.Customcontrol
System.Web.UI.Webcontrol
System.Web.UI.Customcontrols.Webcontrol
None of These
45. Which of the following Generations contains the longest surviving objects?
Generation 0
Generation 1
Generation 3
Generation 2
46. Because .NET treats all languages as equal, a class written in C# should be equivalent to a class written in VB.NET, and an interface defined in Managed C++ should be exactly the same as one that is specified in Managed COBOL. Languages must agree on the meanings of these concepts before they can integrate with one another. Which of the following provides the specifications for this?
CLS
CTS
MSIL
CLI
47. Dot NET Framework programs are compiled into CPU independent instruction set, named:
Microsoft Interpreted Language
Microsoft Intermediate Language
Microsoft Virtual Language
Microsoft Common Language
48. The primary building block of the .NET framework is
ado.NET
assembly
JIT
manifest
49. Where is the application domain created?
Outside a Process
Inside a Process
Can be created  in both the places
None of the above
50. Which of the following statements is correct with regard to .NET framework managed web pages?
They interact directly with the runtime
They do not execute in the native code language
They are interpreted and scripted
All of the above
51. The XML web services of .NET framework are built on :
SOAP
XML
WSDL
All of the above
52. An assembly is unloaded:
By using static method Unload()
By using non static method Unload()
By unloading its application domain
By unloading CLR
53. Which of the following is not a method of FileSystem class?
FileClose
FileInput
LineInput
LOF
54. Which of the following elements can be part of an Assembly:
Type Metadata
MSIL
A set of resources
All of the above
55. Suppose you want to eliminate duplicate elements from the array int[] source = { 7, 4, 1, 3, 9, 8, 6, 7, 2, 1, 8, 15, 8, 23} and sort the elements in descending order using LINQ in .Net framework 4.0. Which of the following statements can you use?
var result = (from s in source orderby s select distinct s).Descending();
var result = (from s in source orderby s descending select s).Distinct();
var result = select distinct s from s in source sortby s descending;
var result = from s in source orderby s descending group p by s select s;
Submit