.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

Posted Date:-2022-08-15 11:01:07


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

Posted Date:-2022-08-15 11:17:32


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

1.Viewstate

2.Application objects

3.Session objects

4.All of the above

Posted Date:-2022-08-15 10:42:19


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

Posted Date:-2022-08-15 11:19:45


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

Posted Date:-2022-08-15 10:57:11


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

1.6

2.5

3.4

4.3

Posted Date:-2022-08-15 10:58:05


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

1.2

2.1

3.More than 3

4.3

Posted Date:-2022-08-15 11:32:14


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

Posted Date:-2022-08-15 11:29:21


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

Posted Date:-2022-08-15 11:12:02


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

1.Session.Discard( )

2.Session.Close( )

3.Session.Abandon

4.Session.End

Posted Date:-2022-08-15 11:21:51


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

Posted Date:-2022-08-15 11:08:22


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

1.Winforms

2.HTMLForms

3.Webforms

4.None of These

Posted Date:-2022-08-15 10:39:41


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

Posted Date:-2022-08-15 11:28:07


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

Posted Date:-2022-08-15 10:53:56


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

Posted Date:-2022-08-15 11:24:18


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

Posted Date:-2022-08-15 10:51:55


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

Posted Date:-2022-08-15 11:10:43


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

1.Milliseconds

2.Nanoseconds

3.Minutes

4.Seconds

Posted Date:-2022-08-15 11:46:01


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

Posted Date:-2022-08-15 10:55:02


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

Posted Date:-2022-08-15 11:06:28


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

Posted Date:-2022-08-15 11:16:28


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

Posted Date:-2022-08-15 11:14:28


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>

Posted Date:-2022-08-15 11:04:25


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

1.Top-down

2.Linear

3.Static

4.Event-driven

Posted Date:-2022-08-15 10:47:01


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

Posted Date:-2022-08-15 11:31:09


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

Posted Date:-2022-08-15 10:59:54


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] );

Posted Date:-2022-08-15 10:43:43


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

Posted Date:-2022-08-15 10:52:50


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

Posted Date:-2022-08-15 10:49:44


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

Posted Date:-2022-08-15 10:59:07


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

Posted Date:-2022-08-15 10:46:01


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

Posted Date:-2022-08-15 11:44:17


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

Posted Date:-2022-08-15 11:45:07


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)

Posted Date:-2022-08-15 11:03:03


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

1.groupby

2.descending

3.ascending

4.orderby

Posted Date:-2022-08-15 11:20:26


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

1.Public

2.Static

3.Private

4.Protected

Posted Date:-2022-08-15 10:44:31


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

1.30u

2.30ul

3.032UU

4.0x4b

Posted Date:-2022-08-15 11:25:09


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

1.Value

2.Numeral

3.Pointer

4.Reference

Posted Date:-2022-08-15 11:25:57


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

1.MSIL

2.CLR

3.CTS

4.CLS

Posted Date:-2022-08-15 11:02:02


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

1.import

2.using

3.package

4.namespace

Posted Date:-2022-08-15 10:21:18


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

Posted Date:-2022-08-15 10:20:35


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

1. Abort

2.Stop

3.Kill

4.Destroy

Posted Date:-2022-08-15 11:18:43


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

Posted Date:-2022-08-15 10:48:47


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

Posted Date:-2022-08-15 11:05:33


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

Posted Date:-2022-08-15 10:47:58


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

Posted Date:-2022-08-15 10:56:01


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

Posted Date:-2022-08-15 10:06:59


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()

Posted Date:-2022-08-15 10:50:34


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

Posted Date:-2022-08-15 11:33:26


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

Posted Date:-2022-08-15 11:07:28


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

Posted Date:-2022-08-15 11:30:23


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}

Posted Date:-2022-08-15 11:13:06


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" />

Posted Date:-2022-08-15 10:08:09


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

Posted Date:-2022-08-15 11:26:49


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;

Posted Date:-2022-08-15 11:15:24


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
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website 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!