These .NET multiple-choice questions and their answers will help you strengthen your grip on the subject of .NET. You can prepare for an upcoming exam or job interview with these .NET MCQs.
So scroll down and start answering.
A. Create a Debugger Users group on your workstation and add your Windows user account to it
B. Add your Windows user account to the Administrators group on ABC-SR01
C. Stop and restart the application pool on ABC-SR01
D. Add the following configuration to the Web.config file <identity impersonate="true" />
A. All of the given options are correct
B. When GC.Collect method is invoked
C. The total memory being used on the managed heap exceeds the acceptable threshold
D. The system has low physical memory
A. import
B. using
C. package
D. namespace
A. True
B. False
A. No
B. Yes
A. The app.config file
B. The web.config file
C. The project's property pages
D. The workstation's machine.config file
A. Yes
B. No
A. Winforms
B. HTMLForms
C. Webforms
A. Viewstate
B. Application objects
C. All of these
D. Session objects
A. Console.WriteLine( myArray(1),(3) );
B. Console.WriteLine( myArray[1][3] );
C. Console.WriteLine( myArray{1}{3} );
D. Console.WriteLine( myArray[1.3] );
A. Public
B. Static
C. Private
D. Protected
A. False
B. True
A. Web Forms, MVC, and Web API
B. All answers are correct.
C. Web Forms and MVC.
D. ASP.NET and MVC
E. SignalR
A. Top-down
B. Linear
C. Static
D. Event-driven
A. Structured language
B. Object oriented
C. All of the given options are correct
D. Component oriented
A. System.AddIn
B. System.Diagnostics
C. System.ComponentModel
D. System.Data
A. System.Web
B. System.ServiceModel
C. System.Net
D. System.Messaging
A. GCCollect()
B. GC.Garbage()
C. GC.Force()
D. GC.Collect()
A. To implement application and session level events
B. Neither of these
C. To declare Global variables
A. Output caching
B. Data caching
C. Output caching and data caching
D. None of these
A. Read( )
B. Fill()
C. ExecuteQuery( )
A. Creates the class Test : Form and creates the class Test that inherits the class Form
B. Creates the class Form that inherits the class Test
C. Creates the class Test : Form
D. Creates the class Test that inherits the class Form
A. ConcurrentBag
B. BlockingCollection
C. ConcurrentDictionary
D. ConcurrentQueue
A. Scripting is separated from the HTML, and code is interpreted separately
B. Scripting is separated from the HTML, code is compiled as a DLL, and DLLs can be executed on the server
C. Code is separated from the HTML, and interpreted code is interpreted separately
A. 6
B. 4
C. 5
D. 3
A. Private
B. Internal
C. Protected
A. When all methods in the class are abstract.
B. When at least one of the methods in the class is abstract.
C. When at least one of the methods in the class is declared.
A. Catches
B. Throws
C. Trys
D. Trys and Catches
A. MSIL
B. CLR
C. CTS
D. CLS
A. constant <data_type> <constant_name> = value;
B. const <data_type> <constant_name> = value;
C. final <data_type> <constant_name> = value;
D. (all of these)
A. True
B. False
A. <compilation debug="true" urlLinePragmas="false"> ... </compilation>
B. <trace enabled="false" pageOutput="true" localOnly="false" />
C. <trace enabled="true" pageOutput="false" localOnly="true" />
D. <compilation debug="false" urlLinePragmas="true"> ... </compilation>
A. System.Data
B. System.Deployment
C. System.Configuration
D. System.ComponentModel
A. Forced
B. Parallel
C. Concurrent
D. Optimized
A. Change the IIS isolation mode and restart the application pool that hosts the application
B. 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
C. Assign the application to a new application pool and run the Aspnet_regiis.exe tool
D. Change the IIS isolation mode and assign the application to a new application pool
A. Add Tag prefix, Tag name
B. Add Source, Tag prefix
C. Add Src, Tagprefix, Tagname
A. Create an interface object
B. Inherit the properties of the interface
C. Contain the same methods as the interface
D. All of these
A. It finds the first occurrence of each letter in the string
B. It generates an error
C. It searches for the first occurrence of the sequence of characters
D. It searches for the first occurrence of any of the characters in the string
A. 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}
B. 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}
C. 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();}
D. Adding this code to the master page: void Application_Error(object sender, EventArgs e){Exception exc = Server.GetLastError();//Write Exception details to event log}
A. public void ProcessRequest(HttpContext ctx){StreamReader sr = new StreamReader(OpenRead(ctx.Server.MapPath("Warning.jpg")));ctx.Response.Pics("pic ");sr.Close();}
B. public void ProcessRequest(HttpContext ctx){StreamReader sr = new StreamReader(_File.OpenRead(ctx.Server.MapPath("Warning.jpg")));ctx.Response(sr.ReadToEnd());}
C. 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.ReadByte()) != -1) {ctx.Response.OutputStream.WriteByte(Convert.
D. public void ProcessRequest(HttpContext ctx){ctx.Response.TransmitFile("image/jpg");(_ctx.Server.MapPath("Warning.jpg"));Stream b = default(Stream);while ((b == fs.ReadByte()) != -1) {ctx.Response.Output.Write((b));}Fs.Close();}
A. HyperLink var = e.Item.Parent.FindControl("hlName") as HyperLink;
B. HyperLink var = rptData.FindControl("hlName") as HyperLink;
C. HyperLink var = Page.FindControl("hlName") as HyperLink;
D. HyperLink var = e.Item.FindControl("hlName") as HyperLink;
A. True
B. False
A. IDisposable
B. INamingContainer
C. IBindableTemplate
D. GCNotificationStatus Enumeration
A. One of the constructors in the class A takes an argument of the type int
B. One of the constructors in the class A takes an argument of the type I, and the class has only a default constructor
C. One of the constructors in the class A takes an argument of the type i
D. Class A has only a default constructor
A. Abort
B. Stop
C. Kill
D. Destroy
A. larger than 185KB
B. Multidimensional arrays
C. larger than 85KB OR Multidimensional arrays
D. larger than 85KB
A. groupby
B. descending
C. ascending
D. orderby
A. Session.Discard( )
B. Session.Close( )
C. Session.Abandon
D. Session.End
A. System.Data.Common
B. System.Data
C. System.Data.Connection
D. System.Data.Interfaces
A. 30u
B. 30ul
C. 032UU
D. 0x4b