.NET Micro Framework/.NET MCQ Set 1 Sample Test,Sample questions

Question:
A method _______ an exception when that method detects that a problem has occured.

1.Catches

2.Throws

3.Trys

4.Trys and Catches


Question:
Evaluate. Which statement must be true for the code to compile and run correctly? public class B : A { public B(int i) :base(i) { } }

1.One of the constructors in the class A takes an argument of the type int

2.One of the constructors in the class A takes an argument of the type I, and the class has only a default constructor

3.One of the constructors in the class A takes an argument of the type i

4.Class A has only a default constructor


Question:
How do you manage states in an ASP.NET application?

1.Viewstate

2.Application objects

3.Session objects

4.All of the above


Question:
How does the .Net framework define a Large Object?

1.larger than 185KB

2.Multidimensional arrays

3.larger than 85KB OR Multidimensional arrays

4.larger than 85KB


Question:
How is ASP.NET different from classic ASP?

1.Scripting is separated from the HTML, and code is interpreted separately

2.Scripting is separated from the HTML, code is compiled as a DLL, and DLLs can be executed on the server

3.Code is separated from the HTML, and interpreted code is interpreted separately

4.None of These


Question:
How many generations does Garbage Collector use for Small Objects in .Net?

1.6

2.5

3.4

4.3


Question:
How many server forms can be added to a .aspx page?

1.2

2.1

3.More than 3

4.3


Question:
How many string objects are created in this piece of code: string first = "tick"; string second = first + "tech"; second += "fly";

1.5

2.1

3.2

4.4


Question:
If an IndexofAny method is passed an array of characters, _______.

1.It finds the first occurrence of each letter in the string

2.It generates an error

3.It searches for the first occurrence of the sequence of characters

4. It searches for the first occurrence of any of the characters in the string


Question:
In ASP.NET, how do you explicitly kill a user session?

1.Session.Discard( )

2.Session.Close( )

3.Session.Abandon

4.Session.End


Question:
In ASP.NET, how do you register a user control?

1.Add Tag prefix, Tag name

2.Add Source, Tag prefix

3.Add Src, Tagprefix, Tagname

4.None of These


Question:
In ASP.NET, postback occurs in which of the following forms?

1.Winforms

2.HTMLForms

3.Webforms

4.None of These


Question:
In ASP.NET, what is the difference between Response.Write() and Response.Output.Write()?

1.In ASP.NET, what is the difference between Response.Write() and Response.Output.Write()?

2.Response.Output.Write() allows you to write formatted output

3.Response.Output.Write() allows you to flush output

4.Response.Output.Write() allows you to buffer output


Question:
In ASP.NET, which method do you invoke on the Data Adapter control to load your generated dataset?

1.Read( )

2.Fill()

3.ExecuteQuery( )

4.None of these


Question:
In ASP.NET, which one of the following namespaces contains the definition for IdbConnection?

1.System.Data.Common

2.System.Data

3.System.Data.Connection

4.System.Data.Interfaces


Question:
In ASP.NET, why is Global.asax used?

1.To implement application and session level events

2.To declare Global variables

3.both (a) and (b)

4.Neither of these


Question:
In C#, for a class to use an interface, it must _______.

1.Create an interface object

2.Inherit the properties of the interface

3.Contain the same methods as the interface

4.All of these


Question:
In C#, how does the following code measures time? Thread.Sleep(time)

1.Milliseconds

2.Nanoseconds

3.Minutes

4.Seconds


Question:
In C#, what does the following code do: class Test: Form { }

1.Creates the class Test : Form and creates the class Test that inherits the class Form

2.Creates the class Form that inherits the class Test

3.Creates the class Test : Form

4.Creates the class Test that inherits the class Form


Question:
In which of the following GC Collection mode the garbage collector determines whether the current time is optimal to reclaim objects?

1.Forced

2.Parallel

3.Concurrent

4.Optimized


Question:
In your Web application named ABCWebApp1, you have configured a custom-templated server control named ABCSC that has child controls in the page. To help ensure distinctive identification of the child controls within the hierarchy of the page, you should consider applying the _______ interface.

1.IDisposable

2.INamingContainer

3.IBindableTemplate

4.GCNotificationStatus Enumeration


Question:
In your Web application, you create a class to implement the IHttpHandler interface. Which code will display the Warning.jpg image in the browser whenever the handler is requested?

1.public void ProcessRequest(HttpContext ctx){StreamReader sr = new StreamReader(OpenRead(ctx.Server.MapPath("Warning.jpg")));ctx.Response.Pics("pic ");sr.Close();}

2.public void ProcessRequest(HttpContext ctx){StreamReader sr = new StreamReader(_File.OpenRead(ctx.Server.MapPath("Warning.jpg")));ctx.Response(sr.ReadToEnd());}

3.public void ProcessRequest(HttpContext ctx){ctx.Response.ContentType = "image/jpg";FileStream fs = File.OpenRead(_ctx.Server.MapPath("Warning.jpg"));int b = 0;while ((b == fs.ReadB

4.public void ProcessRequest(HttpContext ctx){ctx.Response.TransmitFile("image/jpg");(_ctx.Server.MapPath("Warning.jpg"));Stream b = default(Stream);while ((b == fs.ReadByte()) != -1


Question:
To ensure that the timing and performance data of your web application is gathered and only made available to users when they are logged on the web server, which code should you add to the Web.config file?

1.<compilation debug="true" urlLinePragmas="false"> ... </compilation>

2.<trace enabled="false" pageOutput="true" localOnly="false" />

3.<trace enabled="true" pageOutput="false" localOnly="true" />

4.<compilation debug="false" urlLinePragmas="true"> ... </compilation>


Question:
What type of processing model does ASP.NET simulate?

1.Top-down

2.Linear

3.Static

4.Event-driven


Question:
When an .aspx page is requested from the web server, in which format is the output rendered to the browser?

1.wml

2.jip

3.html

4. txt


Question:
When do you have to declare a class abstract?

1.When all methods in the class are abstract.

2.When at least one of the methods in the class is abstract.

3.When at least one of the methods in the class is declared.

4.None of These


Question:
Which C# code will output an element's value from a multidimensional array?

1.Console.WriteLine( myArray(1),(3) );

2. Console.WriteLine( myArray[1][3] );

3.Console.WriteLine( myArray{1}{3} );

4.Console.WriteLine( myArray[1.3] );


Question:
Which caching type is supported by ASP.NET?

1.Output caching

2.Data caching

3.Output caching and data caching

4.None of these


Question:
Which namespace contain the types necessary to build Windows Communication Foundation (WCF) service and client applications?

1.System.Web

2.System.ServiceModel

3.System.Net

4.System.Messaging


Question:
Which of the following "type" of members are accessible only within files in the same DLL ?

1.Private

2.Internal

3.Protected

4.None of These


Question:
Which of the following are part of ASP.NET?

1.Web Forms, MVC, and Web API

2.All answers are correct.

3.Web Forms and MVC.

4.ASP.NET and MVC


Question:
Which of the following defines a String literal?

1.Contains exactly its variable name and nothing else

2.Contains numbers rather than letters

3.Contains only one character

4.A sequence of characters in double quotation marks


Question:
Which of the following defines a Thread?

1.A deprecated object that is no longer used

2.Does not exist

3.An object that wraps itself with other threads

4.An object that allows computer multitasking


Question:
Which of the following is a valid C# constant definition?

1.constant <data_type> <constant_name> = value;

2.const <data_type> <constant_name> = value;

3.final <data_type> <constant_name> = value;

4.(all of these)


Question:
Which of the following is NOT a reserved keyword in C#?

1.groupby

2.descending

3.ascending

4.orderby


Question:
Which of the following is not a VALID C# access specifier ?

1.Public

2.Static

3.Private

4.Protected


Question:
Which of the following is not a VALID integer literal?

1.30u

2.30ul

3.032UU

4.0x4b


Question:
Which of the following is not a VALID variable type in C#?

1.Value

2.Numeral

3.Pointer

4.Reference


Question:
Which of the following is the actual .net code translated into?

1.MSIL

2.CLR

3.CTS

4.CLS


Question:
Which of the following keywords is used to include existing namespace in a C# program?

1.import

2.using

3.package

4.namespace


Question:
Which of the following kick in the Garbage Collector (GC) process?

1.All of the given options are correct

2.When GC.Collect method is invoked

3.The total memory being used on the managed heap exceeds the acceptable threshold

4.The system has low physical memory


Question:
Which of the following methods is used for destroying threads?

1. Abort

2.Stop

3.Kill

4.Destroy


Question:
Which of the following namespaces contain types that enable interaction with system processes, event logs, and performance counters?

1.System.AddIn

2.System.Diagnostics

3.System.ComponentModel

4.System.Data


Question:
Which of the following namespaces contain types that support deployment of ClickOnce applications?

1.System.Data

2.System.Deployment

3.System.Configuration

4.System.ComponentModel


Question:
Which of the following reasons make C# a widely used professional language?

1.Structured language

2.Object oriented

3.All of the given options are correct

4.Component oriented


Question:
Which of the following represents a thread-safe map of key/value pair and can be used in a multi-threaded environment?

1.ConcurrentBag

2.BlockingCollection

3.ConcurrentDictionary

4.ConcurrentQueue


Question:
Which of the following statements is NOT correct with regard to Portable Executable (PE)?

1.Net Framework has extended the PE format with features that support CLR.

2.PE format also include CLR header and CLR data sections.

3.It is opposite to Microsoft Common Object File Format (COFF).

4.None of These


Question:
Which of the following would force an immediate garbage collection of all generations?

1.GCCollect()

2.GC.Garbage()

3.GC.Force()

4.GC.Collect()


Question:
Which particular namespace has to be included in a C# program to be able to use following statement? Console.WriteLine("Hello World")

1.System

2.Console

3.Print

4.WriteLine


Question:
While browsing your Web application in IIS 6.0, you receive a Server Application Unavailable error. The application event log states: It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process. To solve this problem as quickly as possible, you should _______.

1.Change the IIS isolation mode and restart the application pool that hosts the application

2.Assign the application to a new application pool and configure all applications that are part of your application's application pool to use the same version of ASP.NET

3.Assign the application to a new application pool and run the Aspnet_regiis.exe tool

4.Change the IIS isolation mode and assign the application to a new application pool


Question:
You must add a new custom control to an .aspx page in your Web application, with these requirements: • The state of the custom control must remain static for 2 minutes • The cache settings of other elements on the page must not be affected by the settings for the new custom control Which code will meet the requirements when added to the Web.configfile?

1.<caching> <outputCacheSettings> <outputCacheProfiles> <ProfileCache profile="CachedProfileSet" varyByControl="CachedControl" duration="2"> </ProfileCache> </outputCacheProfiles> </output

2.<caching> <outputCacheSettings> <outputCacheProfiles> <ProfileCache profile="CachedProfileSet" varyByControl="CachedControl" duration="120"> </

3.<caching> <outputCacheSettings> <outputCacheProfiles> <addname="CachedProfileSet" varyByParam="CachedControl" duration="2" /> </outputCacheProf

4.<caching> <outputCacheSettings> <outputCacheProfiles> <addname="CachedProfileSet" varyByControl="controlname" duration="120" /> </outputCachePr


Question:
Your Web application includes a page named ErrorPage.aspx. To manage unhandled application exceptions, ErrorPage.aspx should be shown and exception data should be written to the event log. Your web.config file includes the following code: Next, you should consider _______.

1.Adding this code to the Default.asax file: void Application_Error(object sender, EventArgs e){Exception exc = Server.GetLastError();//Write Exception details to event log}

2.Adding this code to the Global.asax file: void Application_Error(object sender, EventArgs e){Exception exc = Server.GetLastError();//Write Exception details to event log}

3.Adding this code to the ErrorPage.aspx file: void Page_Error(object sender, EventArgs e){Exception exc = Server.GetLastError();//Write Exception details to event log Server.ClearError();}

4.Adding this code to the master page: void Application_Error(object sender, EventArgs e){Exception exc = Server.GetLastError();//Write Exception details to event log}


Question:
Your Web application lets users upload files and is hosted in Microsoft IIS 6.0 on a server named ABC-SR01. The application uses the default application pool with Windows Authentication. You cannot upload a file from your workstation using the application; instead, you see an access denied message. To fix this problem, you enable debugging. Next, you should _______.

1.Create a Debugger Users group on your workstation and add your Windows user account to it

2.Add your Windows user account to the Administrators group on ABC-SR01

3.Stop and restart the application pool on ABC-SR01

4.Add the following configuration to the Web.config file <identity impersonate="true" />


Question:
Your Web appplication, ABCApp1, is hosted on ABC-SR13 and runs an instance of MS SQL Server 2005 locally configured to use Windows Authentication. As you prepare to configure the role management and membership providers on ABC-SR13, you should consider using _______.

1.The ASP.NET SQL Server registration tool

2.The Aspnet_compiler.exe command

3.The Aspnet_merge.exe command

4.The Aspnet_compiler.exe command and the aspnet_regiis.exe command


Question:
Your Web form uses the following code to display data from a SQL Server 2005 database. What must you add to the _ItemBound event handler in order to access the value of the hlName HyperLink in a variable named var? ' />

1.HyperLink var = e.Item.Parent.FindControl("hlName") as HyperLink;

2.HyperLink var = rptData.FindControl("hlName") as HyperLink;

3.HyperLink var = Page.FindControl("hlName") as HyperLink;

4.HyperLink var = e.Item.FindControl("hlName") as HyperLink;


More MCQS

  1. .NET Framework MCQ
  2. .NET MCQ Set 1
  3. .NET MCQ Set 2
  4. .NET MCQ Set 3
  5. .NET MCQ Set 4
  6. .NET MCQ Set 5
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!