C# Programming MCQ
C# Programming MCQ
C# Programming MCQ
A.Local
B.Private
C.Static
D.Serial
Answer :A
1. external protect
B.internal protect
C.protect
D.internal
Answer :A
A.None
B.Getvalue
C.Getstring
D.GetNumber
Answer :A
Answer :A
Answer :A
1. By value
2. By reference
3. By address
4. By memory
Answer :A
7.___________________ allow to encapsulate discrete units of functionality and provide a graphical representation of that
functionality to the user
1. controls
2. object
3. class
4. graphics
Answer :A
Answer :A
1. VB 6
2. NET
3. C++
4. Java
Answer :A
Answer :A
11.Which are the standard prefixes for the Button and Combo box controls respectively?
Answer :A
Answer :A
1. Visible
2. Hide
3. Show
4. Enabled
Answer :A
1. solutions
2. assemblies
3. executables
4. namespaces
Answer :A
Answer :A
16.What is a Method?
Answer :A
17.The ____________ of a method describes the types and names of the information that you can pass into the method for it
to process
1. parameter list
2. return type
3. method name
4. method body
Answer :A
18.Consider the following statement remainder = remainder %n which one is equivalent to the above expression
1. remainder %= n
2. remainder =% n
3. remainder = n%
4. remainder = %n%
Answer :A
19.How many times the loop will repeat? for(inti=1; ;i++) { //code }
Answer :A
Answer :A
21.What happens if a try block throws an exception and there is no corresponding catch handler?
Answer :A
1. information hiding
2. polymorphism
3. abstraction
4. grouping
Answer :A
1. indirect type
2. direct type
3. structures
4. enumerations
Answer :A
24.A user needs to enter a DateTime in a text field. You need to parse the value in code. Which method do you use?
1. TryParse
2. Parse
3. ToDateTime
4. Match
Answer :A
25.You are working on a globalized web application. You need to parse a text field where the user enters an amount of
money. Which method do you use?
Answer :A
1. XSD
2. JavaScriptSerializer
3. RegEx
4. StringBuilder
Answer :A
27.Bob and Alice are using an asymmetric algorithm to exchange data. Which key should they send to the other party to make
this possible?
1. “Bob sends Alice his public key, and Alice sends Bob her public key. “
2. “Bob sends Alice his private key, and Alice sends Bob her public key. “
3. “Bob sends Alice his private key, and Alice sends Bob her private key”
4. “Bob sends Alice his public key, and Alice sends Bob her private key”
Answer :A
28.You are creating a new collection type and you want to make sure the elements in it can be easily accessed. What should
you add to the type?
1. Indexer property
2. Constructor
3. Generic type parameter
4. Static property
Answer :A
29.You are creating a complex query that doesn’t require any particular order and you want to run it in parallel. Which
method should you use?
1. AsParallel
2. AsSequential
3. AsOrdered
4. WithDegreeOfParallelism
Answer :A
30.You have received instructions to make sure that IIS errors are handled in accordance with the prerequisites. Which of the
following actions should you take?
1. You should consider bringing the customErrors attribute in the web.config file up to date.
2. You should consider bringing the customErrors attribute in the machine.config file up to date
3. You should consider bringing the customErrors attribute in the app.config file up to date.
4. You should consider bringing the customErrors attribute in the client.config file up to date.
Answer :A
31.You are informed that a run-time exception takes place every time a user tries to access a non- existent item from the item
page. You are instructed to write code that creates a method that routes the exception to the CustomException.aspx page.
Which of the following is the method you should create?
Answer :A
32.”You have been instructed to make sure that the technical prerequisites with regards to scalability are adequately met. To
achieve this, it is necessary to access the web.config file to configure session storage. You want to make use of a SessionState
mode that stores session state in a process that is separate from the ASP.NET worker process or IIS application pool. Which
of the following should you make use of?”
Answer :A
33.”You are employed as a developer at ABC.com. ABC.com has a single Active Directory domain, named ABC.com. You
are making use of Visual Studio 2012 to create a new ASP.NET MVC web application for ABC.com. The new application
allows for users from various countries to access the application based on their respective cultures. As a result, the application
includes various resource files in the Resources directory. These files include a public resource with localized translation. You
are required to make use of a specific WebViewPage property so that the application sets the user’s client browser according
to the settings. Which of the following actions should you take?”
Answer :A
34.You are developing an ASP.NET MVC application that will be deployed to servers on multiple networks. The application
must be compatible with multiple browsers. You must track the page number that the user is viewing in search results. You
need to program the location for storing state information. Where should you persist state information?
1. QueryString
2. Session
3. Application
4. TempData
Answer :A
35.You are developing an ASP.NET MVC web application in Visual Studio 2012. The application requires several thousand
content files. All content is hosted on the same IIS instance as the application. You detect performance issues when the
application starts. You need to resolve the performance issues. What should you do?
Answer :A
36.You are developing an ASP.NET MVC application. You need to authenticate clients by using an ASP.NET membership
database. Which authentication method should you implement?
1. Forms
2. Kerberos
3. Basic
4. Windows
Answer :A
37.You are developing an ASP.NET MVC application. The application is deployed in a web farm and is accessed by many
users. The application must handle web server failures gracefully. The servers in the farm must share the short-term state
information. You need to persist the application state during the session. What should you implement?
1. A state server
2. NET session state
3. A local database
4. Profile properties
Answer :A
38.You are testing an ASP.NET application. The test plan requires that tests run against the application’s business layer. You
need to use the test project template that meets this requirement. Which template should you use?
1. Unit Test Project
2. Web Test Project
3. Load Test Project
4. Coded Test Project
Answer :A
39.You are developing an ASP.NET MVC application. You need to authenticate clients by using NT LAN Manager (NTLM).
Which authentication method should you implement?
1. Windows
2. Basic
3. Forms
4. Kerberos
Answer :A
40.You are developing an ASP.NET MVC application. The application is deployed in a web farm and is accessed by many
users. The application must handle web server failures gracefully. The servers in the farm must share the short-term state
information. You need to persist the Application state during the session. What should you implement?
1. A state server
2. NET session state
3. A local database
4. Profile properties
Answer :A
41.You are developing an ASP.NET MVC application that will be deployed to servers on multiple networks. The application
must be compatible with multiple browsers. You must track the page number that the user is viewing in search results. You
need to program the location for storing state information. Where should you persist state information?
1. QueryString
2. Session
3. Application
4. TempData
Answer :A
42.You are developing an ASP.NET MVC web application in Visual Studio 2012. The application requires several thousand
content files. All content is hosted on the same IIS instance as the application. You detect performance issues when the
application starts. You need to resolve the performance issues. What should you do?
Answer :A
43.You are developing an HTML5 web application and are styling text. You need to use the texttransform CSS
property. Which value is valid for the text-transform property?
1. Lowercase
2. Blink
3. Line-through
4. 20px
Answer :A
44.You are developing an HTML5 web application and are styling text. You need to use the texttransform CSS
property. Which value is valid for the text-transform property?
1. Capitalize
2. Red
3. 20px
4. Italic
Answer :A
45.You are modifying a blog site to improve search engine readability. You need to group relevant page content together to
maximize search engine readability. Which tag should you use?
1. <article>
2. <table>
3. <div>
4. <span>
Answer :A
46.You are modifying a blog site to improve search engine readability. You need to group relevant page content together to
maximize search engine readability. Which tag should you use?
1. <section>
2. <tbody>
3. <div>
4. <table>
Answer :A
47.”You are developing a customer web form that includes the following HTML. <input id=””txtValue””/> You need to
change the HTML markup so that customers can enter only a valid three-letter country code. Which HTML should you use?”
1. “<input id=””txtValue”” type=””country””/>”
2. “<input id=””txtValue”” type=””text”” required=””xxx””/>”
3. “<input id=””txtVa!ue”” type=””text”” pattern-“” [A-Za-z] {3} “”/>”
4. “<input id=””txtValuen type=””code”” pattern””=””country””/>”
Answer :A
48.You are developing an HTML5 web application and are styling text. You need to use the text transform CSS
property. Which value is valid for the text-transform property?
1. Capitalize
2. Hidden
3. Italic
4. Line-through
Answer :A
49.You are developing an HTML5 web application and are styling text. You need to use the text transform CSS
property. Which value is valid for the text-transform property?
1. Capitalize
2. Italic
3. Line-through
4. 20px
Answer :A
50.You are modifying a blog site to improve search engine readability. You need to group relevant page content together to
maximize search engine readability. Which tag should you use? content together to maximize search engine readability.
Which tag should you use?
1. <article>
2. <tbody>
3. <div>
4. <span>
Answer :A
51.You are modifying a blog site to improve search engine readability. You need to group relevant page content together to
maximize search engine readability. Which tag should you use?
1. <section>
2. <span>
3. <nav>
4. <cable>
Answer :A
52.You are developing an HTML5 web application and are styling text. You need to use the text transform CSS
property. Which value is valid for the text-transform property? transform CSS property. Which value is valid for the text-
transform property?
1. lowercase
2. red
3. hidden
4. italic
Answer :A
53.You are developing an HTML5 web application and are styling text. You need to use the text transform CSS
property. Which value is valid for the text-transform property?
1. lowercase
2. 20px
3. line-through
4. italic
Answer :A
54.You are developing an HTML5 web application and are styling text. You need to use the text transform CSS
property. Which value is valid for the text-transform property?
1. Capitalize
2. Italic
3. Red
4. Line-through
Answer :A
55.”You are building an ADO.NET Entity Framework application. You need to validate the conceptual schema definition
language (CSDL), store schema definition language (SSDL), and mapping specification language (MSL) files. Which
Entity Data Model tool can you use? (Each correct answer presents a complete solution. Choose all that apply.)”
Answer :A
56.You are designing an ASP.NET Web API application. You need to select an HTTP verb to allow blog administrators to
moderate a comment. Which HTTP verb should you use?
1. POST
2. GET
3. DELETE
4. PUT
Answer :A
57.You are planning to migrate websites from IIS 6 to IIS 7.5. You do not have access to SSH or a VPN. You need to select a
deployment tool to securely migrate the websites. Which tool should you use?
1. Web Deploy
2. RoboCopy
3. Microsoft command-line FTP
4. xCopy
Answer :A
58.You are developing an ASP.NET MVC application. Applications can be deployed to remote servers only by
administrators who have elevated privileges. The administrators do not have access to Visual Studio 2012. You need
to select a deployment tool to deploy the application to remote servers for testing. Which tool should you use?
Answer :A
59.You are developing an ASP.NET MVC application that reads and writes data from a SQL Server database. You
need to prevent the application from reading data that is locked by other transactions. You also need to prevent
exclusive range locks. Which isolation level should you use?
1. ReadCommitted
2. Serializable
3. Repeatable
4. ReadUncommitted
Answer :A
60.You are developing a WCF service. A new service instance must be created for each client session. You need to choose an
instancing mode. Which instance mode should you use?
1. PerSession
2. PerCall
3. Single
4. Multiple
Answer :A
61.You are developing a WCF service. A new service instance must be created for each client request. You need to choose an
instancing mode. Which instancing mode should you use?
1. PerCall
2. Single
3. PerRequest
4. Multiple
Answer :A
62.You are designing an ASP.NET Web API application. You need to select an HTTP verb to allow blog administrators to
remove a comment. Which HTTP verb should you use?
1. DELETE
2. PUT
3. POST
4. GET
Answer :A
63.You are developing an ASP.NET MVC application that reads and writes data from a SQL Server database. You
need to maintain data integrity in all situations that use transactions.
1. Serializable
2. ReadUncommitted
3. Repeatable
4. ReadCommitted
Answer :A
64.”You are developing an ASP.NET MVC application. Deployment administrators do not have access to Visual Studio
2102, but will have the elevated permissions required to deploy the application to the servers. You need to select a
deployment tool for use by the deployment administrators. Which tool should you use?”
Answer :A
65.”You are employed as a developer at ABC.com. ABC.com has a single Active Directory domain, named
ABC.com. You are in the process of creating a new application using ASP.NET Web API. You have been informed that blog
administrators should have the ability to regulate blog comments. You, therefore, have to configure the use of a suitable
HTTP verb. Which of the following is the HTTP verb you should use?”
1. PUT
2. GET
3. SET
4. LOCATE
Answer :A
66.”You are employed as a developer at ABC.com. ABC.com has a single Active Directory domain, named
ABC.com. You are in the process of creating a new application using ASP.NET MVC Web API. You have been informed
that the Web API method names should correspond with the RESTful services naming recommendations. Which of the
following is a suitable method to retrieve data in an HTTP service?”
Answer :A
67.You need to recommend a data access technology to the contractor to retrieve data from the new data source. Which data
access technology should you recommend?
Answer :A
68.Data provided by Consolidated Messenger is cached in the HttpContext.Cache object. You need to ensure that the cache is
correctly updated when new data arrives. What should you do?
1. Use the CacheDependency type configured to monitor the SFTP target folder.
2. Ensure that the EffectivePrivateBytesLimit value is greater than the size of the database file.
3. Change the sliding expiration of the cache item to 12 hours.
4. Use the SqlCacheDependency type configured with a connection string to the database file.
Answer :A
69.You need to load flight information provided by Consolidated Messenger. Which should you use?
Answer :A
70.You need to load flight information provided by Consolidated Messenger. What should you use?
Answer :A
71.You need to make the “Distance” header of the table bold in the Views/RunLog/GetLog.cshtml view. Which code segment
should you use?
Answer :A
72.You need to make all of the rows in the table bold in the Views/RunLog/GetLog.cshtml view. Which code segment should
you use?
Answer :A
73.You need to implement client-side animations according to the business requirements. Which line of code should you use?
(Each correct answer presents a complete solution. Choose all that apply.)
1. $(“body h1:nth-child(1)”).fadeOut(1000);
2. $(“body h1:nth-child(1)”).fadeIn(1000);
3. $(“body h1:nth-child(1)”).animate({ opacity: 1 });
4. None of the above
Answer :A
74.You have been instructed to insert a line of code into your existing code that allows for the Distance” header of the table to
be displayed in bold in the Views/CyclingLog/GetLog.cshtml view. Which of the following should be included in the line of
code?
Answer :A
75.”You have been tasked with making sure that the application is configured to make use of a ustom role provider, named
CyclingLogRoleProvider. Which of the following actions should you take?”
Answer :A
76.”You are building an ADO.NET Entity Framework application. You need to validate the conceptual schema definition
language (CSDL), store schema definition language (SSDL), and mapping specification language MSL) files. Which Entity
Data Model tool can you use? (Each correct answer presents a complete solution. hoose all that apply.)”
Answer :A
77.You are designing an ASP.NET Web API application. You need to select an HTTP verb to allow blog administrators to
moderate a comment. Which HTTP verb should you use?
1. POST
2. GET
3. DELETE
4. PUT
Answer :A
78.You are planning to migrate websites from IIS 6 to IIS 7.5. You do not have access to SSH or a VPN. You need to select a
deployment tool to securely migrate the websites. Which tool should you use?
1. Web Deploy
2. RoboCopy
3. Microsoft command-line FTP
4. xCopy
Answer :A
79.You are developing an ASP.NET MVC application. Applications can be deployed to remote servers only by administrators
who have elevated privileges. The administrators do not have access to Visual Studio 2012. You need to select a deployment
tool to deploy the application to remote servers for testing. Which tool should you use?
Answer :A
80.You develop an ASP.NET MVC application that is secured by using SSL. You are ready to deploy the application to
production. The deployment package must include the installation of the SSL certificate. You need to configure the
deployment package to meet the requirement. What should you do?
1. Create a web publish pipeline target file with a custom web deploy target.
2. “In the Package/Publish settings of the project, select the All Files in this project option.
3. Extend the CopyAllFilesToSingleFolder target in the project file.
4. “In the Build Events settings of the project, configure a pre-build event to include the SSL certificate.”
Answer :A
81.You are developing an ASP.NET MVC application that reads and writes data from a SQL Server database. You need to
prevent the application from reading data that is locked by other transactions. You also need to prevent exclusive range locks.
Which isolation level should you use?
1. ReadCommitted
2. Serializable
3. Repeatable
4. ReadUncommitted
Answer :A
82.You are developing a WCF service. A new service instance must be created for each client session. You need to choose an
instancing mode. Which instance mode should you use?
1. PerSession
2. PerCall
3. Multiple
4. PerRequest
Answer :A
83.You are developing a WCF service. A new service instance must be created for each client request. You need to choose an
instancing mode. Which instancing mode should you use?
1. PerCall
2. Single
3. PerRequest
4. PerSession
Answer :A
84.You are designing an ASP.NET Web API application. You need to select an HTTP verb to allow blog administrators to
remove a comment. Which HTTP verb should you use?
1. DELETE
2. PUT
3. POST
4. GET
Answer :A
85.You are developing an ASP.NET MVC application that reads and writes data from a SQL Server database. You need to
maintain data integrity in all situations that use transactions.
1. Serializable
2. ReadUncommitted
3. Repeatable
4. ReadCommitted
Answer :A
86.”You are developing an ASP.NET MVC application. Deployment administrators do not have access to Visual Studio
2102, but will have the elevated permissions required to deploy the application to the servers. You need to select a
deployment tool for use by the deployment administrators. Which tool should you use?”
Answer :A
87.”You are employed as a developer at ABC.com. ABC.com has a single Active Directory domain, named ABC.com. You
are in the process of creating a new application using ASP.NET Web API. You have been informed that blog administrators
should have the ability to regulate blog comments. You, therefore, have to configure the use of a suitable HTTP verb. Which
of the following is the HTTP verb you should use?”
1. PUT
2. GET
3. SET
4. LOCATE
Answer :A
88.”You are employed as a developer at ABC.com. ABC.com has a single Active Directory domain, named ABC.com. You
are in the process of creating a new application using ASP.NET MVC Web API. You have been informed that the Web API
method names should correspond with the RESTful services naming recommendations. Which of the following is a suitable
method to retrieve data in an HTTP service?”
Answer :A
89.”You are employed as a developer at ABC.com. ABC.com has a single Active Directory domain, named ABC.com. You
are in the process of creating ASP.NET MVC Web API application. You are required to write code that includes a member of
the TransferMode Enumeration. The selected member should allow for the request message to be buffered and the response
message to be streamed. Which of the following actions should you take?”
Answer :A
90.You need to recommend a data access technology to the contractor to retrieve data from the new data source. Which data
access technology should you recommend?
Answer :A
91.Data provided by Consolidated Messenger is cached in the HttpContext.Cache object. You need to ensure that the cache is
correctly updated when new data arrives. What should you do?
1. Use the CacheDependency type configured to monitor the SFTP target folder.
2. Ensure that the EffectivePrivateBytesLimit value is greater than the size of the database file.
3. Change the sliding expiration of the cache item to 12 hours.
4. Use the SqlCacheDependency type configured with a connection string to the database file.
Answer :A
92.You need to load flight information provided by Consolidated Messenger. Which should you use?
Answer :A
93.You need to load flight information provided by Consolidated Messenger. What should you use?
Answer :A
94.”Arrange following datatype in order of increasing magnitude sbyte, short, long, int.”
Answer :A
95.”Which statement is correct about following c#.NET code? int[] a= {11, 3, 5, 9, 6};”
1. ’a’ is a reference to an object of a class that compiler drives from ‘System.Array’ class
2. ’a’ is reference to the array created on stack
3. ’a’ is a reference to an object created on stack
4. None of the mentioned
Answer :A
1. By value.
2. By reference.
3. By address.
4. By memory.
Answer :A
Answer :A
98.Which of the following statements is correct about classes and objects in C#.NET?
Answer :A
99.”Which of the following statements is correct about the C#.NET code snippet given below? class Student s1, s2; // ere
‘Student’ is a user-defined class.s1 = new Student(); s2 = new Student();”
Answer :A
100.The assemblies provided by Trey Research must be merged into a single assembly. You need to merge the assemblies
provided by Trey Research and meet the application specification. What should you do?
1. “Use the ILMerge.exe tool to merge the assemblies provided by Trey Research, and then stipulate the output must be
signed with the Trey.snk key pair.
2. Use the ILMerge.exe tool to merge the Trey Research assemblies without stipulating a key pair.
3. “In the post-build event, use the Assembly Linker (al.exe) tool to sign the application’s primary output assembly with
the Trey.snk key pair.”
4. Use the sn.exe tool to generate a key pair file named TreyVendor.snk. Use the ILMerge.exe tool to merge the
assemblies provided by Trey Research. Use the Assembly Linker (al.exe) tool to sign the application’s primary output
assembly with the TreyVendor.snk key pair.
Answer :A
——————————————————————————————————————————————————
——————————————————————————————————————-
Course Name: C#
1. component-oriented
2. non-procedural language
3. declarative
4. none
Answer : A
1. Projects
2. Solutions
3. None
4. Test
Answer : A
1. Solutions
2. Assemblies
3. Executables
4. namespaces
Answer : A
1. False
2. TRUE
3. Both
4. None
Answer : A
What is a variable?
1. A variable is a memory area where you can store value which can be manipulated later
2. A variable is a statement that instructs to perform different actions at different context
3. A variable is a condition which defines alternative action based on value stored in it
D.None
Answer : A
Which special variable holds the value assigned to the set accessor of a property?
1. Value
2. Data
3. Args
4. param
Answer : A
Answer : A
Answer : A
Answer : A
Answer : A
Answer : A
Answer : A
1. {}
2. ()
3. Begin End
4. []
Answer : A
Answer : A
15 If a variable can be used at a particular location in a program, the variable is said to be in ________ at that location
1. scope
2. boundary
3. variable
4. confined
Answer : A
1. local variable
2. global variable
3. member variable
4. instance variable
Answer : A
Answer : A
1. A Boolean operator is an operator that performs a calculation whose result is either true or false
2. A Boolean operator always operates on Boolean values and produces a Boolean value as result
3. A Boolean operator is used to control a loop
4. None
Answer : A
19 Consider the following statement remainder = remainder %n which one is equivalent to the above expression
1. remainder %= n
2. remainder =% n
3. remainder = n%
4. remainder = %n
Answer : A
Answer : A
21 C# makes it easy to separate the error handling code from the code that implements the main flow of the program by
Answer : A
Answer : A
23 What happens if any statement inside a try block generates error?
1. The runtime throws an exception and transfers control to the finally block
2. The runtime throws an exception and transfers control directly to the first matching catch handler
3. The runtime throws an exception and stops the execution of program
4. The runtime throws an exception and transfers control to error routine
Answer : A
1. an exception an error
2. a System.object type
3. A disposable type
Answer : A
1. checked
2. unchecked
3. loop
4. decision
Answer : A
26 __________ provide a convenient mechanism for modeling the entities manipulated by applications.
1. Classes
2. Objects
3. Namespaces
4. Enumerations
Answer : A
Answer : A
1. information hiding
2. grouping
3. abstraction
4. polymorphism
Answer : A
1. new
2. create
3. open
4. object
Answer : A
30 What happens if you do no write any constructor for your class?
31 A static class can contain both static and non-static members.
1. FALSE
2. True
3. Both
4. None
Answer : A
Answer : A
1. value type
2. reference type
3. integral type
4. null type
Answer : A
34 What happens If you specify an index that is less than 0 or greater than or equal to the length of the array
Answer : A
Answer : A
36 The basic collection classes accept, hold, and return their elements as
1. objects
2. integers
3. value types
4. enumerations
Answer : A
1. Queue
2. Stack
3. Hashtable
4. ArrayList
Answer : A
1. Stack
2. Hashtable
3. Queue
4. ArrayList
Answer : A
1. Hashtable
2. Stack
3. ArrayList
4. Queue
Answer : A
40 Calling a method to achieve the effect on a field feels a little clumsy. What then does alleviate this awkwardness?
1. Properties
2. Events
3. Constructors
4. All of the above
Answer : A
Answer : A
1. A Property
2. A method
1. public field
2. An Event
Answer : A
1. statement
2. variable
3. syntax
4. code
Answer : A
1. direct type
2. indirect type
3. structures
4. enumerations
Answer : A
1. indirect type
2. structures
3. enumerations
4. direct type
Answer : A
Answer : A
1. unboxing
2. casting
3. boxing
4. explicit casting
Answer : A
48 Consider the statement System.Windows.Forms.TextBoxt;What value does the reference t hold?
1. null
2. nothing
3. 0
4. empty
Answer : A
49 ____________ is the technical term for declaring two or more methods with the same name in the same scope
1. Overloading
2. Overriding
3. Inheritance
4. Casting
Answer : A
Answer : A
1. Derived class
2. Child class
3. New calss
4. System.Object class
Answer : A
1. sealed
2. static
3. void
4. const
Answer : A
53 Which keyword do you use to refer a base class’s member from the derived class?
1. base
2. this
3. parent
4. super
Answer : A
1. virtual method
2. new method
3. null method
4. overloaded method
Answer : A
55 What do you call the concept “providing different implementations of the base class’s method in a derived class”?
1. Overriding
2. casting
3. Hiding
4. Overloading
Answer : A
56 Which class does not allow creating create instances of it?
1. Abstract class
2. Sealed class
3. Interface class
4. All of the above
Answer : A
1. A tilde (~)
2. A hash(#)
3. A pipe(|)
4. A minus (-)
Answer : A
58 process of destroying an object and returning memory back to the heap is known as
1. Garbage collection
2. Memory management
3. Resource collection
4. Destruction
Answer : A
59 How can you release the resource yourself as quickly as possible?
Answer : A
60 The _______ statement provides a clean mechanism for controlling the lifetimes of resources
1. using
2. switch
3. do
4. checked
Answer : A
61 Which one defines whether the operator evaluates from left to right or from right to left?
1. Operator associativity
2. Operator precedence
3. Operator overloading
4. None of the above
Answer : A
1. Unary operator
2. Binary operator
3. Trinary Operator
4. None of the above
Answer : A
1. Binary operator
2. Unary operator
3. Trinary Operator
4. None of the above
Answer : A
1. Dot (.)
2. Equality (==)
3. Increment (++)
4. Plus (+)
Answer : A
Answer : A
67 Which property of a windows form should you change to set the text shown on the title bar?
1. Text
2. Title
3. TitleText
4. You cannot change that
Answer : A
Answer : A
69 Which property of a form can be used to control the level of transparency?
1. Opacity
2. BackColor
3. Transparency
4. None of the above
Answer : A
70 Which property of a form returns the control that is currently in focus?
1. ActiveControl
2. CurrentControl
3. FocusedControl
4. TabIndex
Answer : A
71 What is the purpose of the implemented Dispose method in windows form control?.
Answer : A
72 Which visual studio generated method instantiate all controls you added to a form and set their properties, wires event
handler with controls?
1. InitializeComponent
2. Initialize
3. InitializeContols
4. There is no such method
Answer : A
73 Which event is raised just before a windows form is actually closed?
1. FormClosing
2. Closing
3. Disposing
4. FormDisposing
Answer : A
74 What is the return type of the static method Show the MessageBox?
1. DialogResult
2. ButtonState
3. string
4. int
Answer : A
1. MenuStrip
2. MainMenu
3. Menu
4. ToolStrip
Answer : A
76 Which property of a menu item is used to show a text as tip when the user hovers the mouse over the menu item?
1. ToolTip
2. ContextMenu
3. ToolText
4. Top
Answer : A
77 What do you call the menu which is shown when users right-clock on a control?.
1. Pop-up menu
2. DropdownMenu
3. Menu
4. Properties
Answer : A
1. Some common and standard dialog boxes supplied with windows OS that can be used with your own applications
2. Some common controls that are share between two or more applications
Answer : A
Answer : A
80 Which property indicates whether a control raises validation event or not?
1. CausesValidation
2. Validation
3. Validate
4. Check
Answer : A
1. true
2. false
3. 0
4. null
Answer : A
82 The Validated occurs ________ Validating.
1. After
2. Before
3. None
4. All
Answer : A
83 You are developing an ASP.NET Web application. You create a master page. The master page requires a region where
you can add page-specific content by using the ASP.NET page designer. You need to add a control to the master page to
define the region.Which control should you add?
1. Content Placeholder
2. Content
3. Placeholder
4. Substitution
Answer : A
84 You are developing an ASP.NET MVC 2 application. A view contains a form that allows users to submit their first
name. You need to display the value that is submitted, and you must ensure that your code avoids crosssite scripting. Which
code segment should you use?
Answer : A
85 You are deploying an ASP.NET Web application to a remote server. You need to choose a deployment method that will
ensure that all IIS settings, in addition to the Web content, will deploy to the remote server. Which deployment method should
you choose?
Answer : A
86 You are developing an ASP.NET Dynamic Data Web application.Boolean fields must display as Yes or No instead of as
a check box. You replace the markup in the default Boolean field template with the following markup.<asp:Label
runat=”server” ID=”label” />You need to implement the code that displays Yes or No. Which method of the
FieldTemplateUserControl class should you override in the BooleanField class?
1. OnDataBinding
2. OnLoad
3. Construct
4. SaveControlState
Answer : A
87 You are developing an ASP.NET Web page that will display the median value from a sequence of integer values. You
need to create an extension method to compute the median value. Which interface should you add the extension method to?
1. IEnumerable<T>
2. IComparer<T>
3. IEnumerator<T>
4. IEqualityComparer<T>.
Answer : A
88 How to change the image of an image control place in each row in a gridview
1. ItemDataBound
2. Init
3. Prerender
4. All of the above
Answer : A
89 Which directive defines master page-precise attributes that are used by the ASP.NET page parser and compiler?
1. @ Master
2. @ MasterType
3. @ PageType
4. @ MasterPage
90 You have to store user data of 200 KB in an object. Which state management technique to use
1. Server session
2. Cookie
3. View State
4. Hidden Field
91 You use the ADO.NET Entity Framework to model your entities. You use ADO.NET self-tracking entities.You need to
ensure that the change-tracking information for the self-tracking entities can be used to update the database.Which
ObjectContext method should you call after changes are made to the entities?
1. ApplyChanges
2. SaveChanges
3. Refresh
4. Attach
Answer : A
92 Which class should you use to manage multiple tables and relationships among them?
1. DataSet
2. DataTable
3. DataView
4. DataRow
Answer : A
93 In ADO.NET, which class can start an explicit transaction to update a SQL Server database?
1. SqlConnection
2. SqlCommand
3. SqlParameter
4. SqlException
Answer : A
94 When working with LINQ to SQL, what is the main object that moves data to and from the database?
1. DataContext
2. DataSet
3. SqlDataAdapter
4. Entity
Answer : A
1. string
2. Boolean
3. int
4. Char
Answer : A
1. CLR
2. ASP.NET Applications
3. Win Form Applications
4. Windows Services
Answer : A
97 Which of the following is the root of the .NET type hierarchy?
1. System. Object
2. System. Type
3. System. Base
4. System. Root
Answer : A
1. Java
2. C#
3. J#
4. VB.NET
Answer : A
99 Which of the following is the correct way to create an object of the class Sample?
Answer : A
100 Which of the following can be used to terminate a while loop and transfer control outside the loop?
1. break
2. exit statement
3. continue
4. exit while
Answer : A
——————————————————————————————————————————————————
——————————————————————————————————————-
C#
classProgram
int x = 10;
int y = x++;
int z = x + y;
Console.WriteLine(“y = ” + y + ” z = ” + z);
Console.ReadKey();
1. y = 11 z = 21
2. y = 10 z = 21
3. y = 10 z = 20
4. y = 11 z = 20
Correct Answer: B
2. Which of the following will be the correct output for the C#.NET code snippet given below?
String s2;
s2 = s1.Substring(12, 3);
Console.WriteLine(s2);
Correct Answer: B
3. Which statement is correct for constant?
4. Declare using const keyword
5. You can assign its value in the constructor
6. You must assign a value at the time of declaration
7. Both A and C
Correct Answer: D
classProgram
Console.WriteLine(10 + 20 / 5);
Console.ReadKey();
Correct answer: B
Correct Answer: A
6. Which of the following statements is not TRUE about the .NET CLR?
Answer: D
Correct Answer: D
9. Which of the following .NET components can be used to remove unused references from the managed heap?
Correct Answer: C
1. C# is case sensitive
2. White space is ignored
3. Indicate single line comment by using \\
4. Indicate multiple line comment by using /*and*/
Correct Answer: C
11. Which of the following assemblies can be stored in Global Assembly Cache?
1. Private Assemblies
2. Friend Assemblies
3. Shared Assemblies
4. Public Assemblies
Correct Answer: C
12. Code that targets the Common Language Runtime is known as
1. Unmanaged
2. Legacy
3. Managed Code
4. Native Code
Correct Answer: C
namespace mahedee.net
classProgram
Console.ReadLine();
1. Size of int: 8
2. Size of int: 4
3. Size of int: {0}
4. Error
Answer: B
1. >=
2. !=
3. <=
4. <>=
Answer: D
classProgram
int d;
Console.WriteLine(d);
Console.ReadKey();
1. 1
2. 0
3. -1
4. Error
Answer: A
16. Which of the following is the correct output for the C#.NET code snippet given below?
Console.WriteLine(13 / 2 + ” ” + 13 % 2);
6. 6.5 1
7. 6.5 0
8. 60
9. 61
Answer: D
1. &&
2. ||
3. !
4. %
Answer: D
18. What will be the output of the C#.NET code snippet given below?
intnum = 1, z = 5;
if (!(num<= 0))
else
Console.WriteLine( –num + z– + ” ” + –z );
1. 56
2. 65
3. 66
4. 77
Answer: D
19. What is the value of output variable of the following code snippet?
int a = 10;
int b = 20;
bool output;
Answer: C
Answer: A
21. In which of the following is false for a method if they are to be treated as overloaded methods?
1. Type of arguments
2. Return type of methods
3. Number of arguments
4. Order of arguments
Answer: B
1. Yes No
Answer: B
23. Which of the following statements are not correct about constructors in C#.NET?
Answer: A
24. How many times can a constructor be called during lifetime of the object?
Answer: B
1. Yes No
Answer: A
Answer: B
27. Which of the following statements are correct about static functions?
Answer: D
namespace ConsoleApplication1
classSample
static Sample()
publicstaticvoid Display()
classMyProgram
{
staticvoid Main(string[] args)
Sample.Display();
Answer: A
Answer: C
30. Which of the following statements will correctly copy the contents of one string into another?
1. String s1 = “String”;
String s2;
s2 = s1;
1. String s1 = “String” ;
String s2;
s2 = String.Concat(s1, s2);
1. String s1 = “String”;
String s2;
s2 = String.Copy(s1);
1. String s1 = “String”;
String s2;
s2 = s2.StringCopy(s1);
Answer: C
31. The string built using the String class are immutable (unchangeable), whereas, the ones built- using the StringBuilder
class are mutable.
1. True False
Answer: A
32. Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = “Dhaka,”;
String s2;
s2 = s1.Insert(6, “Bangladesh”);
Console.WriteLine(s2);
1. Dhaka,Bangladesh
2. Dhaka, Bangladesh
3. Dhaka
4. Dhaka,
Answer: A
33. If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two
references?
1. s1 is s2
2. s1 == s2
3. strcmp(s1, s2)
4. s1.Equals(s2)
Answer: D
34. What will be the output of the C#.NET code snippet given below?
classMyProgram
1. 0
2. String
3. Hello Bangladesh?
4. System.Int32
Answer: D
35. Which of the following will be the correct output for the C#.NET code snippet given below?
Stringstr = “mahedee.net”;
Console.Write(str.IndexOf(‘h’) + ” “);
Console.Write(str.Length);
1. 3 10
2. 2 11
3. 3 11
4. 2 10
Answer: B
Answer: D
37. Which of the following statement is correct about a String in C#.NET?
Answer: D
38. Which of the following will be the correct output for the C#.NET code snippet given below?
int c;
c = s1.CompareTo(s2);
Console.WriteLine(c);
1. 0 B. 1
2. 2 D. -1
Answer: D
1. True B. False
Answer: A
40. Which of the following statements is correct about properties used in C#.NET?
Answer: B
Answer: B
42. A derived class can stop virtual inheritance by declaring an override as
1. inherits
2. extends
3. inheritable
4. sealed
Answer: D
Answer: D
44. Which of the following modifier is used when a virtual method is redefined by a derived class?
1. overloads
2. override
3. overridable
4. virtual
Answer: B
45. In order for an instance of a derived class to completely take over a class member from a base class, the base class has
to declare that member as
1. new
2. base
3. virtual
4. overrides
Answer: Option C
Answer: C
47. Which of the following are necessary for Run-time Polymorphism?
Answer: D
1. Long
2. Short
3. Byte
4. Integer
Answer: A
1. Integer
2. Single
3. String
4. Long
Answer: C
1. 4 byte
2. 8 byte
3. 16 byte
4. 32 byte
Answer: C
51. What will be the output of the following code snippet when it is executed?
int x = 1;
float y = 1.1f;
short z = 1;
Console.WriteLine((float)x + y * z – (x += (short)y));
1. 0.1 B. 1.0
2. 1.1 D. 11
Answer: A
52. Which of the following is the correct ways to set a value 3.14 in a variable pi such that it cannot be modified?
3. float pi = 3.14F;
4. #define pi 3.14F;
5. const float pi = 3.14F;
6. const float pi; pi = 3.14F;
Answer: C
53. Which of the following is the correct default value of a Boolean type?
1. 0 B. 1
2. True D. False
Answer: D
54. Which of the following statements are not correct about functions and subroutines used in C#.NET?
1. While using ref keyword any changes made to the parameter in the method will be reflected in that variable when
control passes back to the calling method.
Answer: A
55. Which of the following will be the correct output for the C#.NET program given below?
namespace mahedee.net
classSampleProgram
int a = 5;
int s = 0, c = 0;
Console.WriteLine(s + ” ” + c);
ss = x * x;
cc = x * x * x;
1. 00
2. 25 25
3. 125 125
4. 25 125
Answer: D
1. 1
2. 0
3. Depends upon how many params arguments does it use.
4. Any number of values.
Answer: A
namespace mahedee.net
classSampleProgram
int a = 5;
int s = 0, c = 0;
s, c = fun(a);
Console.WriteLine(s +” ” + c) ;
staticint fun(int x)
intss, cc;
ss = x * x; cc = x * x * x;
returnss, cc;
59. What will be the output of the C#.NET code snippet given below?
namespace mahedee.net
classSampleProgram
int i = 5;
int j;
fun1(ref i);
fun2(out j);
Console.WriteLine(i + “, ” + j);
staticvoid fun1(refint x)
x = x * x;
staticvoid fun2(outint x)
x = 6;
x = x * x;
}
}
1. 5, 6
2. 5, 36
3. 25, 36
4. 25, 0
Answer: C
Answer: D
61. What will be the output of the C#.NET code snippet given below?
namespace mahedee.net
classBaseclass
publicvoid fun()
classDerived1 : Baseclass
newvoid fun()
{
classDerived2 : Derived1
newvoid fun()
classProgram
Derived2 d = newDerived2();
d.fun();
1. Base class
2. Derived1 class
3. Derived2 class
4. Base class Derived1 class
Answer: A
62. Which of the following should be used to implement a ‘Has a’ relationship between two entities?
Answer: C
63. Which of the following is correct about the C#.NET snippet given below?
namespace mahedee.net
classBaseclass
publicvoid fun()
Console.WriteLine(“Hi” + ” “);
publicvoid fun(int i)
Console.Write(“Hello” + ” “);
classDerived : Baseclass
publicvoid fun()
Console.Write(“Bye” + ” “);
}
}
classMyProgram
Derived d;
d = newDerived();
d.fun();
d.fun(77);
Answer: Option B
64. In an inheritance chain which of the following members of base class are accessible to the derived class members?
1. static
2. protected
3. private
4. shared
Answer: B
1. Inheritance
2. Encapsulation
3. Templates
4. Polymorphism
Answer: Option A
66. Which of the following should be used to implement a ‘Like a’ or a ‘Kind of’ relationship between two entities?
Answer: D
Answer: C
Answer: A
Answer: C
70. Which of the following statements is correct about a namespace used in C#.NET?
1. Properties
2. Methods
3. Enumerations
4. Events
Answer: C
72. Which of the following statements is correct about Interfaces used in C#.NET?
Answer: B
73. Which of the following statements is correct about an interface used in C#.NET?
Answer: Option A
1. When a class inherits an interface it inherits member definitions as well as its implementations.
2. An interface cannot contain the signature of an indexer.
3. Interfaces members are automatically public.
4. To implement an interface member, the corresponding member in the class must be public as well as static.
Answer: C
75. Which of the following statements is correct about the C#.NET code snippet given below?
interfaceIPerson
String FirstName
{
get;
set;
String LastName
get;
set;
void Print();
void Stock();
int Fun();
Answer: B
namespace mahedee.net
classProgram
enumPlanets
{
Mercury = 2437,
Venus = 6095,
Earth = 6378
PlanetsaPlanet = Planets.Earth;
switch (aPlanet)
casePlanets.Earth:
break;
casePlanets.Venus:
break;
casePlanets.Mercury:
break;
default:
break;
}
Console.ReadKey();
Answer: B
77. The C#.NET code snippet given below generates ____ numbers series as output?
78. Prime B. Fibonacci
79. Palindrome D. Odd
Answer: Option B
78. Which of the following statements is correct about the C#.NET code snippet given below?
s1 = new Student();
s2 = new Student();
Answer: C
79. Which of the following is the correct output of the C#.NET code snippet given below?
Console.WriteLine(a.Length);
1. 20 B. 4
2. 18 D. 10
Answer: Option C
80. Which of the following is NOT a .NET Exception class?
1. Exception
2. StackMemoryException
3. DivideByZeroException
4. OutOfMemoryException
Answer: Option B
Answer: Option C
82. Which of the following statements are correct about exception handling in C#.NET?
1. If an exception occurs then the program terminates abruptly without getting any chance to recover from the exception.
2. No matter whether an exception occurs or not, the statements in the finally clause (if present) will get executed.
3. A program can contain multiple finally clauses.
4. A finally clause is written outside the try block.
Answer: Option B
83. Which of the following statements is correct about the C#.NET program given below if a value “ABCD” is input to it?
using System;
namespace mahedee.net
classMyProgram
int index;
intval = 55;
int[] a = new int[5];
try
index = Convert.ToInt32(Console.ReadLine());
a[index] = val;
catch(FormatException e)
catch(IndexOutOfRangeException e)
Answer: Option D
84. All code inside finally block is guaranteed to execute irrespective of whether an exception occurs in the protected
block or not.
Answer: Option A
Answer: Option C
86. “There should never be one reason for a class to change” – this statement is for –
87. Single Responsibility Principle
88. Open-closed Principle
89. Liskov substitution Principle
90. Interface segregation Principle
Answer: Option A
87. “How closely related methods and class level variables are in a class” – this statement is related to –
88. Single Responsibility Principle
89. Open-closed Principle
90. Cohesion
91. Coupling
Answer: Option C
88. “Software entities should be open for extension, but closed for modification ” – this statement is related to–
Answer: Option B
89. “Subtypes must be substitutable for their base types” – this statement is related to–
90. Single Responsibility Principle
91. Open-closed Principle
92. Liskov substitution Principle
93. Interface segregation Principle
Answer: Option C
90. “Clients should not be forced to depend on the methods they do not use” – this statement is related to–
91. Single Responsibility Principle
92. Open-closed Principle
93. Liskov substitution Principle
94. Interface segregation Principle
Answer: Option D
91. “High level modules should not depend upon low level modules. Both should depend on abstractions.” – this
statement is related to–
92. Dependency Inversion Principle
93. Open-closed Principle
94. Liskov substitution Principle
95. Interface segregation Principle
Answer: Option A
92. Which of the following base class do all web forms inherit from?
1. Window class
2. Web class
3. Form class
4. Page class
Answer: Option D
93. Which of the following object encapsulates the state of the client and the browser?
1. Request object
2. Response object
3. Session object
4. Application object
Answer: C
94. ___________section of the web.config file is used for storing a list of authorized users.
1. authentication
2. authorization
3. a and b
4. None
Answer: B
1. RegularExpressionValidator
2. RangeValidator
3. FieldValidator
4. PatternValidator
Answer: A
96. What is the property name of a GridView (or a DataGrid) that regulates the sorting?
1. Sorting
2. EnableSorting
3. DisableSorting
4. AllowSorting
Answer: D
ASP.NET MVC
1. Razor
2. Spark
3. HTML
4.
Answer: C
Answer: B
Answer: C
100. Which of the following display data in MVC pattern?
101. Model
102. View
103. Controller
104. None
Answer: B
SQL Server
Correct Answer: D
Correct Answer: A
——————————————————————————————————————————————————
——————————————————————————————————————-
……………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………
Ans: A
A. Abstract methods
B. Non Abstract methods
C. Both
D. None
Ans: C
A. private
B. public
C. protected
D. internal
Ans: B
4. Which of the following statements is incorrect about delegate?
Ans : D
A. True
B. False
C. Maybe
D. Can’t say
Ans: A
Ans: C
7. Reference is a ___.
Ans: D
A. protected, public
B. private, public
C. private
D. public
Ans: C
9. What is the value returned by function compareTo( ) if the invoking string is less than the string compared?
A. Zero
B. A value of less than zero
C. A value greater than zero
D. None of the mentioned
Ans: B
Ans: D
11. Select the two types of threads mentioned in the concept of multithreading?
A. Foreground
B. Background
C. Only foreground
D. Both foreground and background
Ans: D
Ans: A
13. If a class ‘demo’ had ‘add’ property with getting and set accessors, then which of the following statements will work
correctly?
A. math.add = 20;
B. math m = new math();
m.add = 10;
C. Console.WriteLine(math.add);
D. None of the mentioned
Ans: A
14. What will be the output of the following code snippet?
using System;
class sample
{
int i;
double k;
public sample (int ii, double kk)
{
i = ii;
k = kk;
double j = (i) + (k);
Console.WriteLine(j);
}
~sample()
{
double j = i - k;
Console.WriteLine(j);
}
}
class Program
{
static void Main(string[] args)
{
sample s = new sample(9, 2.5);
}
}
A. 0 0
B. 11.5 0
C. Compile-time error
D. 11.5 6.5
Ans : D
A. 2 16 4
B. 4 8 16
C. 2 4 8
D. 8 16 64
Ans: A
A. Protected
B. Public
C. Private
D. Default
Ans: C
A. Default point
B. Invoking point
C. Calling point
D. Throw point
Ans: D
A. Every derived class does not define its own version of the virtual method.
B. By default, the access mode for all methods in C# is virtual.
C. If a derived class, does not define its own version of the virtual method, then the one present in the base class gets used.
D. All of the above.
Ans: B
class sample
{
public sample()
{
Console.WriteLine("constructor 1 called");
}
public sample(int x)
{
int p = 2;
int u;
u = p + x;
Console.WriteLine("constructor 2 called");
}
}
class Program
{
static void Main(string[] args)
{
sample s = new sample(4);
sample t = new sample();
Console.ReadLine();
}
}
A. constructor 1 called
constructor 2 called
B. constructor 2 called
constructor 1 called
C. constructor 2 called
constructor 2 called
D. error
Ans: B
20. Which of the following keywords is used to refer base class constructor to subclass constructor?
A. this
B. static
C. base
D. extend
Ans: C
A - abstract
B - as
C - foreach
Answer : D
Explanation
Answer : A
Explanation
A - ToDecimal
B - ToDouble
C - ToInt16
D - ToInt32
Answer : C
Explanation
Q 4 - Which of the following operator determines whether an object is of a certain type in C#?
A - ?:
B - is
C - as
D-*
Answer : B
Explanation
Q 5 - Which of the following access specifier in C# allows a class to hide its member variables and member functions from
other functions and objects?
A - Public
B - Private
C - Protected
D - Internal
Answer : B
Explanation
Private access specifier allows a class to hide its member variables and member functions from other functions and objects.
Q 6 - Which of the following property of Array class in C# gets the rank (number of dimensions) of the Array?
A - Rank
B - LongLength
C - Length
Answer : A
Explanation
A - Member variables are the attributes of an object (from design perspective) and they are kept private to implement
encapsulation.
B - These private variables can only be accessed using the public member functions.
Answer : C
Explanation
B - false
Answer : A
Explanation
Q 9 - Which of the following preprocessor directive lets you modify the compiler's line number and (optionally) the file name
output for errors and warnings in C#?
A - elif
B - endif
C - line
D - region
Answer : C
Explanation
#line − It lets you modify the compiler's line number and (optionally) the file name output for errors and warnings.
A - The exception classes in C# are mainly directly or indirectly derived from the System.Exception class.
Answer : C
Explanation
Both of the a
A.TreeNodes
B.TreeView
C.Collection
D.TreeNodeCollection
Click for answer
D.TreeNodeCollection
2.The Windows Forms__________control displays a hierarchy of nodes, like the way files and folders are displayed in the left pane of
the Windows Explorer feature in Windows operating systems.
A.ContextMenuStrip
B.TreeView
C.Splitter
D.ToolStrip
Click for answer
B.TreeView
A.Node
B.TreeNodeCollection
C.TreeNode
D.None of above
Click for answer
C.TreeNode
4.Windows Forms _________ controls are used to resize docked controls at run time.
A.Timer
B.Splitter
C.ContextMenuStrip
D.None of above
Click for answer
B.Splitter
5.________ class represents a control consisting of a movable bar that divides a container's display area into two resizable panels.
A.Splitter
B.Container
C.ContextMenuStrip
D.SplitContainer
Click for answer
D.SplitContainer
6.The Windows Forms __________ is a component that raises an event at regular intervals.
A.Splitter
B.delegate
C.Timer
D.None of these
Click for answer
C.Timer
7.The __________ control provides a shortcut menu that you associate with a control.
A.ContextMenuStrip
B.ToolStrip
C.ToolStripTextBox
Click for answer
A.ContextMenuStrip
A.ContextMenu
B.MenuStrip
C.ToolStrip
D.Menu
Click for answer
A.ContextMenu
A. True
B. False
C. None of the mentioned.
D. None of the Above
View Answer
Workspace
Report
Discuss
Answer: Option B
View Answer
Workspace
Report
Discuss
Answer: Option C
Explanation:
Static constructor is a constructor which can be called before any object of class is created or any static method is
invoked.Static constructor is implicitly called by .net CLR
View Answer
Workspace
Report
Discuss
Answer: Option C
Explanatio
View Answer
Workspace
Report
Discuss
Answer: Option D
Answer: Option D
Explanation:
6. “A mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse.In short
it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code
and data.”
A. Abstraction
B. Polymorphism
C. Inheritance
D. Encapsulation
View Answer
Workspace
Report
Discuss
Answer: Option D
Explanation:
Ans: A
2. The CLR is physically represented by an assembly named _______.
A. mscoree.dll
B. mcoree.dll
C. msoree.dll
D. mscor.dll
Ans: A
Ans: B
4. The ____ language allows more than one method in a single class.
A. C#
B. J#
C. C++
D. C
Ans: A
5. In C#, a subroutine is called a ________.
A. Function
B. Metadata
C. Method
D. Managed code
Ans: C
A. Class()
B. Main()
C. Submain()
D. Namespace
Ans: B
A. Constant
B. Reference type
C. Variable
D. Object
Ans: C
A. Keywords
B. literal
C. variables
D. Identifiers
Ans: A
A. Bool type
B. Instance type
C. Class type
D. Object type
Ans: D
A. Unary operator
B. Ternary operator
C. Decision operator
D. Functional operator
Ans: B
A. Center-associative
B. Right-associative
C. Left-associative
D. Top-associative
Ans: C
12. An _______ is a symbol that tells the computer to perform certain mathematical or logical manipulations.
A. Operator
B. Expression
C. Condition
D. Logic
Ans: A
A. goto
B. Label
C. Logical
D. Bitwise
Ans: B
14. C# has _______ operator, useful for making two way decisions.
A. Looping
B. Functional
C. Exponential
D. Conditional
Ans: D
15. ________causes the loop to continue with the next iteration after skipping any statements in between.
A. Loop
B. Exit
C. Break
D. Continue
Ans: D
16. An ____ is a group of contiguous or related data items that share a common name.
A. Operator
B. Integer
C. Exponential
D. Array
Ans: D
A. Reference
B. Logical
C. Value
D. Arithmetic
Ans: A
18. Multidimensional arrays are sometimes called _______ Arrays.
A. Square
B. Triangular
C. Rectangular
D. Cube
Ans: C
19. ______ parameters are used to pass results back to the calling method.
A. Input
B. Reference
C. Value
D. Output
Ans: D
A. Square
B. Semicolon
C. Parenthesis
D. Colon
Ans: C
21. _______ variables are visible only in the block they are declared.
A. System
B. Global
C. Local
D. Console
Ans: C
A. parameterized
B. parameter-less
C. Class
D. Method
Ans: B
23. A structure in C# provides a unique way of packing together data of ______ types.
A. Different
B. Same
C. Invoking
D. Calling
Ans: A
A. Protected
B. Public
C. Private
D. Default
Ans: C
A. Copy constructor
B. Default constructor
C. Invoking constructor
D. Calling constructor
Ans: A
26. The methods that have the same name, but different parameter lists and different definitions is called______.
A. Method Overloading
B. Method Overriding
C. Method Overwriting
D. Method Overreading
Ans: A
27. The C# provides special methods known as _____ methods to provide access to data members.
A. Loop
B. Functions
C. Methods
D. Accessor
Ans: D
28. When an instance method declaration includes the abstract modifier, the method is said to be an ______.
A. Abstract method
B. Instance method
C. Sealed method
D. Expression method
Ans: A
29. The theory of _____ implies that user can control the access to a class, method, or variable.
A. Data hiding
B. Encapsulation
C. Information Hiding
D. Polymorphism
Ans: B
A. Commutative
B. Associative
C. Transitive
D. Iterative
Ans: C
31. The point at which an exception is thrown is called the _______.
A. Default point
B. Invoking point
C. Calling point
D. Throw point
Ans: D
A. Method
B. Function
C. Error
D. Iterative
Ans: C
33. C# treats the multiple catch statements like cases in a _____________ statement.
A. If
B. Switch
C. For
D. While
Ans: B
34. C# supports a technique known as________, which allows a method to specify explicitly the name of the interface it
is implementing.
A. Method Implementaion
B. Implicit Interface Implementation
Ans: C
35. The reason that C# does not support multiple inheritances is because of ______.
A. Method collision
B. Name collision
C. Function collision
D. Interface collision
Ans: B
36. _______ is a set of devices through which a user communicates with a system using interactive set of commands.
A. Console
B. System
C. Keyboard
D. Monitor
Ans: A
37. Exponential formatting character (‘E’ or ‘e’) converts a given value to string in the form of _______.
A. m.dddd E+xxx
B. m.dddd
C. E+xxx
D. None of the above
Ans: A
38. The ______ are the Graphical User Interface (GUI) components created for web based interactions..
A. Web forms
B. Window Forms
C. Application Forms
Ans: B
39. In Microsoft Visual Studio, ______ technology and a programming language such as C# is used to create a Web
based application.
A. JAVA
B. J#
C. VB.NET
D. ASP.NET
Ans: D
40. The controls available in the tool box of the ______ are used to create the user interface of a web based application.
B. Application window
C. Web forms
Ans: A
41.The infrastructure that supports these dynamic operations at run time is called the__________.
A.CLR
B.CTS
C.CLS
D.DLR
Ans: D
42.The___________keyword is new to C# 4.0, and is used to tell the compiler that a variable's type can change or that it is
not known until runtime.
A.Covariance
B.dynamic
C.Contravariance
D.Object
Ans: B
A.Anonymous
B.Static
C.Abstract
D.Extension
Ans: D
44.myMobile.Accept(55, inReject: false); Above statement is an example of which new concept of C# 4.0?
A.Named Parameters
B.Optional Parameters
C.dynamic
D.Variance
Ans: A
A.out
B.named
C.base
D.ref
Ans: D
A.False
B.True
Ans: B
47._________parameters allows you to give a method parameter a default value so that you do not have to specify it every
time you call the method.
A.optional
B.named
C.out
D.ref
Ans: A
A.dynamic
B.object
C.ref
D.base
Ans: A
A. Template, Component
B. CLR, CTS
D. Windows, desktop
Ans: A
50. The ______ parentheses that follow _____ indicate that no information is passed to Main ().
A. Empty, class
B. Empty, submain
C. Empty, Main
D. Empty, Namespace
Ans: C
A. Yes
B. No
Ans: B
52. What is the wild card character in the SQL "like" statement?
A. * (Asterisk)
B. # (Pound)
C. % (Percent)
D. $ (Dollar)
Ans: C
53. Which of the following is the root of the .NET type hierarchy?
A. System.Object
B. System.Base
C. System.Root
D. System.Parent
Ans: A
54. C# doesnot support:
A. abstraction
B. polymorphism
C. multiple inheritance
D. inheritance
Ans: C
55. Your company uses Visual Studio.NET 2005 as its application development platform. You are developing an
application using the .NET Framework 2.0. You are required to use a datatype that will store only numbers ranging from
-32,768 to 32,767. Which of the following datatypes will you use to accomplish the task?
A. short
B. System.Int16
C. string
D. a and b
Ans: D
56. Which of the following jobs are NOT performed by Garbage Collector?
(A) 1, 2, 3
(B) 1, 4, 5
(C) 3, 5
(D) 3, 4
Ans: B
B. Managed code is the code that is written to target the services of the CLR.
Ans: B
A. The runtime checks to see that only one version of an assembly is on the machine at any one time.
C. .NET allows assemblies to specify the name AND the version of any assemblies they need to run.
D. It doesn.t.
Ans: C
A. Single-Dimensional
B. Multidimensional
C. Jazzed arrays
D. Jagged arrays
Ans: C
A. Local
B. Private
C. Static
D. Serial
Ans: A
61. Two methods with the same name but with different parameters.
A. Overloading
B. Multiplexing
C. Duplexing
D. Loading
Ans: A
62. Which file contains configuration data for each unique URl resource used in project?
A. web.config
B. global.asax
C. webapplication.vsdisco
D. assemblyinfo.cs
Ans: A
63. Features of Read only variables
C. It is allocated at runtime
Ans: D
D. All of above
Ans: D
A. Yes
B. No
Ans: A
1. ASP.NET Applications
2. CLR
5. Windows Services
(A) 2, 5
(B) 2, 1
(C) 2, 3
(D) 3, 4
Ans: C
67. Which of the following statements is correct about the C#.NET program given below?
namespace PskillsConsoleApplication
class Baseclass
{
int i;
{
i = ii;
Console.Write("Base ");
}
}
{
Console.Write("Derived ");
}
}
class MyProgram
{
{
}
}
D. The program will work correctly only if we implement zero-argument constructors in Baseclass as well as Derived
class.
Ans: C
A. mscorjit
B. cil
C. dgclr
D. None
Ans: B
D. None of these
Ans: A
70. Which of the following .NET components can be used to remove unused references from the managed heap?
A. Class Loader
B. Garbage Collector
C. CTS
D. CLR
Ans: B
Ans: b
72. An instance variable
A. is an object of a class
C. is a method of a class
D. a and c
Ans: b
D. a and b
E. a and c
Ans: e
D. a and b
Ans: a
75. A Constructor
C. is a method of a class
D. maybe overloaded
E. b and c
Ans: e
D. a and b
Ans: b
A. Static
B. Private
C. Local
D. Serial
E. b and d
Ans: c
78. Defining two methods with the same name but with different parameters is called.
A. Loading
B. Overloading
C. Multiplexing
D. Duplexing
Ans: b
79. Find any errors in the following BankAccount constructor: Public int BankAccount() { balance = 0; }
A. Name
B. Formal parameters
C. Return type
D. No errors
Ans: c
80. In the body of a method, C# uses the variable named_____to refer to the current object whose method is being invoked
A. call
B. this
C. do
D. that
Ans: b
81.String mystring; Creates a(n)
A. class
B. Constructor
C. Object
D. a and b
Ans: c
82. An Event is
B. result of a party
Ans: a
A. a Wahsington representative
Ans: b
84. Is it possible to pass methods as arguments for other methods without modification.
A. True
B. False
Ans: a
A. True
B. False
Ans: b
86. What is the proper header for a class that intends to use an interface.
E. class MyCalss(IFace)
Ans: c
D. a and b
Ans: e
88. Every class directly or indirectly extends the______class.
A. System
B. Object
C. Drawing
D. Console
Ans: b
Ans: b
B. Maintain the same return type and arguments as the parent class, but implement it differently
C. Have different return types and arguments than the parent class
D. Are Virtual
Ans: b
A. myArray[1][3];
B. myArray[1.3];
C. myArray{1}{3};
D. myArray(1),(3);
Ans: a
A. True
B. False
Ans: b
93. Methods that are declared abstract in the base class must show implementation at the time of declaration.
A. True
B. False
Ans: b
B. Defines a class that inherits the public and protected methods of A only
C. Errors
D. a and b
Ans: b
95. Assuming that public class B : A { public B(int i) :base(i) { } } compiles and runs correctly, what can we conclude about
the constructors in the class A?
D. False
Ans: b
96. Classes declared with the sealed keyword cannot be base class.
A. True
B. False
Ans: a
97. A method_____an exception when that method detects that a problem has occured.
A. Trys
B. Catches
C. Throws
D. a and b
Ans: c
A. Try
B. Catch
C. Exception
D. Event
E. System
Ans: c
D. a and b
Ans: e
A. Try
B. Catch
C. Exception
D. Error
E. a and b
Ans: a