Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
17 views

C# Programming-Mcq

Uploaded by

Rama Subramanian
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

C# Programming-Mcq

Uploaded by

Rama Subramanian
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 157

Programming MCQ -C#

May 25, 2015 Leave a comment


SL Question Answer A B C D
A variable which is declared
1 inside a method is called A Local Private Static Serial
a variable
Which of the following are
2 not types of access modifiers A external protect internal protect protect internal
in C#?
Microsoft Visual C# is
3 Microsoft’s powerful, C declarative
non-procedural component-oriented none
language
language
4 are basic
organization component of A Projects Solutions Test none
visual studio
5 Related projects are grouped
together into A Solutions Assemblies Executables namespaces
Solutions cannot contain
6 projects of different types and B True FALSE
languages
A variable is a A variable is a A variable is a
memory area where statement that instructs condition which
7 What is a variable? A you can store to perform defines alternative None
different actions at action based on
value which can be different context value stored in it
manipulated later
Which special variable holds
8 the value assigned to the set A Value Data Args
accessor of a property?
the rules to write
9 Which one correct definition a command to perform statements in
aA
the specification of None
of a statement? an actions particular what statements do
programming language
the rules to write
Which one correct definition statements in a command to perform the specification of
a
A particular what statements do
None
10 of syntax? an action
programming
language
the rules to write
11 Which one correct the specification statements in a a command to
definition of semantics? A of what statements None
particular perform an
do programming action
language
12 Which of the following is are
valid identifiers in C#? A Counter1 1stnumber $payRate class

13 Which one defines Definite C# does not allow C# does not


Assignment Rule in C#? A C# does not C# does not allow
us to use an allow declaring us to use variable require Definite
variable inside a outside a method
unassigned variable method
Assignment
14 What is a Method? A A named sequence of A decision statement An iteration structure It is member of
a class not of an
statement object
15 Which of the
following encloses A {} () Begin End []
method body?

16 you want a method to return you must write a


information A you must add
return statement inside you must capture it void keyword as all of the above
return type
If a variable can be used at a the method
particular location in a
17 program, the variable is said C variable boundary scope confined
to be in at that
location
18 A variable declared inside a
method is called a D instance variable global variable member variable local variable
Which one is a read-only
The property that The property that The property that None of the
A contains only get contains only set block
contains both get and
19 property? set block above
block
A Boolean operator is A Boolean operator

20 Which one correctly defines a an operator that always operates on


Boolean operator? A Boolean operator is
A performs a used to control a loop None
Boolean values and
produces a
calculation whose Boolean value as
result is either true or result
Consider the following false
statement remainder =
21 remainder %n which one is B remainder =% n remainder %= n remainder = n% remainder = %n
equivalent to the above
expression
The variable in a loop This variable which
controls the number of The variable whose
22 What is a sentinel variable? A changed inside value causes a loop to None
iterations that the loop exit early
it performs
C# makes it easy to separate
23 the error handling code from using exceptions and using checked and
the code that implements the A none
exception handlers unchecked operations using error handler
main flow of the program by
What is the purpose of catch
to catch and handle to prevent program to runtime to
a
24 handler in an exception A specific type of to report about errors
from crushing1+l trap data loss
handling mechanism? exception
The runtime throws an The runtime throws an
The runtime throws
The runtime
What happens if any exception and exception and transfers throws an
25 statement inside a try block A control directly to the an exception and exception and
generates error? transfers control to the first matching catch stops the execution of transfers control

finally block program


handler
to error routine
Ordered sequence of None of the
26 What is an array? A Unordered sequence of Random sequence of
elements elements element above
Arrays are ,
27 regardless of the type of A value type reference type integral type null type
their elements.
What happens If you specify The compiler throws
28 an index that is less than 0 or an Nothing
Null is returned 0 value is returned
greater than or equal to the A IndexOutOfRangeExc happens
length of the array eption
29 Where the collection classes In System.
are live in? A Collections In System. Collection In .NET Frame work In system
namespace & sub-
The basic collection classes namespace
30 accept, hold, and return their D enumerations integers value types objects
elements as
The class implements a
31 first-in, first-out (FIFO) A Queue Stack Hashtable ArrayList
mechanism
The class implements a
32 last-in, first-out (LIFO) B Queue Stack Hashtable ArrayList
mechanism
33 Which operator you cannot
overload? A Dot (.) Equality (==) Increment (++) Plus (+)
Which one is implicit double d; int a = 20; int
int a
None of the
d = a; double d=2.33; a
A Convert.ToDouble( “
34 casting? = a; = (int)d
20.33”) above
int a; double d=2.33; a double d; int a = 20; int a None of the
d
=
35 Which one is explicit casting? = a;
Convert.ToDouble( “
= (int)d 20.33”) above
A

Which property of a
windows form should you You cannot
A Text Title TitleText
36 change to set the text shown change that
on the title bar?
37 Which is the statement for None of the
running an application Application.Run( System.Run(Form Form.Run(Form
form? A For m instance); instance); instance); above
38 Which one is used
create Menu? A MenuStrip MainMenu Menu ToolStrip
39 Which is the purpose data To enusure that To ensure
A
data entered by a To ensure data is output produced All of the above
by the
user correctly processed
validation? application is in
matches business rules correct format
40 You are developing an A Content Placeholder Content Placeholder Substitution
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?
Which class should you use
41 to manage multiple tables and A DataSet DataTable DataView DataRow
relationships among them?
In ADO.NET, which class
42 can start an explicit
transaction to update a SQL A SqlConnection SqlCommand SqlParameter SqlException
Server database?
When working with LINQ
to SQL, what is the main
object A DataContext DataSet SqlDataAdapter Entity
43 that moves data to and from
the database?
44 Which of the following is not
a .NET compatible language? A Java C# J# VB.NET
Which of the following can
45 be used to terminate a
while loop and transfer A break exit statement continue exit while
control
outside the loop?
Which is the correct output
46 for the following code A A. y = 11 z = 21 y = 10 z = 21 B. y = 10 z = 20 y = 11 z = 20
snippet?
Which of the following will
be the correct output for the A ARE CRE CR REA
47 C#.NET code snippet given
below?
Declare using const You can assign its You must assign a
48 Which statement is correct value in the value at the time Both A and C
for constant? A keyword constructor of declaration
What is the output of the
following code snippet?
classProgram
{
publicstaticvoid Main(string[]
49 args)
{ A 6 14 Both A and B None of above
Console.WriteLine(10 + 20
/ 5);
Console.ReadKey();
}
}
50 Which of the following A String s1 = String s1 = “String” ; String s1 = “String”; String s1 =
String s2; String s2;
statements will correctly “String”; String s2; s2 = String.Concat(s1, s2 = String.Copy(s1) “String”;
copy the contents of one s2 = s1; s2) String s2;
string into another ? s2 =
s2.StringCopy(s
1)
The string built using the
String class are immutable
51 (unchangeable), whereas, the
ones built- using the B FALSE TRUE
StringBuilder class are
mutable.
Which of the following will
52 be the correct output for the
C#.NET code snippet given B Dhaka, Bangladesh Dhaka,Bangladesh Dhaka Dhaka,
below?
You are designing an
ASP.NET Web API
application. You need to
53 select an HTTP verb to
allow blog administrators to
remove a comment. Which
HTTP verb should you use?
You are developing an
ASP.NET MVC application
that reads and writes data
54 from a SQL Server
database. You need to
maintain data integrity in all
situations that use
transactions.
If s1 and s2 are references to
two strings, then which of the
55 following is the correct way D s1 is s2 s1 == s2 strcmp(s1, s2) s1.Equals(s2)
to compare the two
references?
C PUT POST DELETE GET

D ReadUncommitted Repeatable ReadCommitted Serializable

56 Which of the following is not Integer Long


value types? Single String
A
57 What is the size of a
Decimal? A 4byte 8byte 16byte 32byte
What will be the output of the
following code snippet when
it is executed?
58 int x = 1;
float y = 1.1f; 0.1 1 1.1 11
short z = 1;
Console.WriteLine((float)x +
y * z – (x += (short)y));
59 is the validation RegularExpressionVal RangeValidator FieldValidator PatternValidato
control used for “Pattern
matching” idator
What is the property name of
60 a GridView (or a DataGrid) Vsorting EnableSorting DisableSorting AllowSorting
that regulates the sorting?

61 In SOLID Object Oriented Simple


Principle SRP means? A Simple Responsibility Single Repository Single Responsibility
Principle Principle Repository
Principle
There should never be one Principle
Single Responsibility Liskov substitution Interface
62 reason for a class to change” A Open-closed Principle Principle segregation
– this statement is for – Principle Principle
You are designing an
ASP.NET Web API
application. You need to
63 select an HTTP verb to C GET DELETE POST PUT
allow blog administrators to
moderate a comment. Which
HTTP verb should you use?
64 The throw statement needs
object to throw. B a System.object type an exception an error A disposable type
All integer arithmetic in a
65 statement always
throws an D unchecked loop decision checked
OverflowException
provide a
convenient mechanism for A Classes Objects Namespaces Enumerations
modeling the entities 66
manipulated by applications.
you write
67 What do you do when you you systematically
you protect your statemnts to
B you group information arrange information
into a meaningful
information from manipulate
design a class? for global access being altered information
entity
from database
68 Encapsulation is
sometimes referred to as A information hiding grouping abstraction polymorphism
Which keyword is used to
69 create new instance of a
class? A new create open object
What happens if you do no Compilers generate a You class is
You cannot create You class does
70 write any constructor for your default constructor for objects from the not compile treated as a
A class? you class structure
A static class can contain
71 both static and non- B Trues FALSE
static members
1.A variable which is declared inside a method is called a variable

A.Local

B.Private

C.Static

D.Serial

Answer :A

2. Which of the following are not types of access modifiers in C#?

1. external protect

B.internal protect

C.protect

D.internal

Answer :A

3. ”In data reader, what can be used before read

method?” A.None

B.Getvalue

C.Getstring

D.GetNumber

Answer :A

4. An Event has as default return type

1. No return type for events


2. String
3. Double
4. Integer

Answer :A

5.What object can help you maintain data across users?


1. Application Object
2. Session object
3. Server Object
4. Response Object

Answer :A

6.”In C#, by default structs are passed how?”

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

8.What does Dispose method do with connection object?

1. Deletes it from the memory


2. Close the connection
3. Temporary dispose the connection
4. Permanently dispose the connection

Answer :A

9.Which language is not a true object-oriented programming language?

1. VB 6
2. NET
3. C++
4. Java

Answer :A

10.Which is not a main component of the Visual Studio IDE?


1. Start Menu
2. Solution Explorer
3. Tool Box
4. Properties Window

Answer :A

11.Which are the standard prefixes for the Button and Combo box controls respectively?

1. btn and cbo


2. btn and chb
3. bto and chb
4. cmd and cbo

Answer :A

12.Which statement about objects is true?

1. One class can create many objects


2. One object is used to create one class.
3. One class is used to create one object
4. One object can create many classes.

Answer :A

13.Which property determines whether a control is displayed to the user?

1. Visible
2. Hide
3. Show
4. Enabled

Answer :A

14.Related projects are grouped together into

1. solutions
2. assemblies
3. executables
4. namespaces

Answer :A

15.Consider the statement N= 5; What type of statement is it?

1. An assignment statement; it assign value 5 to variable N


2. variable declaration
3. A selection statement
4. It is not a valid c#

statement Answer :A

16.What is a Method?

1. A named sequence of statement


2. A decision statement
3. An iteration structure
4. It is member of a class not of an object

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 }

1. This loop will never terminate


2. 0
3. 1
4. This loop will not compile

Answer :A

20.Whatis the purposeof catch handler in an exception handlingmechanism?

1. to catch and handle a specifictype of exception


2. to prevent program from crushing1+l
3. to report about errors to runtime
4. to trap data loss

Answer :A

21.What happens if a try block throws an exception and there is no corresponding catch handler?

1. The program terminates with an unhandled exception


2. The runtime executes its own error routine and executes next statement
3. The runtime exits the try block and tries to execute statement immediately after the try block.
4. None of the above

Answer :A

22.Encapsulation is sometimes referred to as

1. information hiding
2. polymorphism
3. abstraction
4. grouping

Answer :A

23.Reference types are some time called

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?

1. “decimal.TryParse(value, NumberStyles.Currency, UICulture); “


2. “int.TryParse(value, NumberStyles.Currency, UICulture); “
3. “decimal.TryParse(value, ServerCulture); “
4. TryParse(value) ;

Answer :A

26. You need to validate an XML file. What do you use?

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?

1. The RegisterGlobalFilters method.


2. The RegisterLocalFilters method.
3. The JoinGlobalFilters method.
4. The JoinLocalFilters method.

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?”

1. You should consider making use of the StateServer mode.


2. You should consider making use of the In-process mode.
3. You should consider making use of the Off mode.
4. You should consider making use of the SQLServer mode.

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?”

1. You should consider making use of the ViewBag property.


2. You should consider making use of the ViewContext property.
3. You should consider making use of the Html property.
4. You should consider making use of the ViewData property.

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?

1. Combine the content files by using ASP.NET MVC bundling.


2. Enable compression in IIS.
3. Move the content to a second server.
4. Implement HTTP caching in IIS.

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?

1. Combine the content files by using ASP.NET MVC bundling.


2. Implement HTTP caching in the ASP.NET MVC controllers.
3. Install a second IIS instance.
4. Move the content to a Windows Azure CDN

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.)”

1. EDM Generator (EdmGen.exe)


2. Entity Data Model Wizard
3. Update Model Wizard
4. None of the above

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?

1. Web Deployment Package


2. Copy Web Site Tool
3. One-Click Publish
4. Publish Web Site Tool

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?”

1. Web Deployment Package


2. One-Click Publish
3. Publish Web Site Tool
4. Deployment Package Editor

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?”

1. The GET method.


2. The SET method.
3. The PUT method.
4. The POST method.

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?

1. WCF Data Services


2. LINQ to XML
3. NET Entity Framework
4. NET DataSets

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?

1. OleDbConnection and OleDbDataReader


2. SQL Server Data Transformation Services (DTS)
3. EntityTransaction and EntityCommand
4. Office Open XML

Answer :A

70. You need to load flight information provided by Consolidated Messenger. What should you use?

1. OleDbConnection and OleDbDataReader


2. Office Open XML
3. COM interop
4. EntityConnection and

EntityDataReader 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?

1. table > tr > th:nth-child(2) { font-weight: bold; }


2. table > tr { font-weight: bold; }
3. table > th:last-child { font-weight: bold; }
4. table + first-child { font-weight: bold; }

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?

1. table > tr { font-weight: bold; }


2. table > th:last-child { font-weight: bold; }
3. table + first-child { font-weight: bold; }
4. table > tr > th:nth-child{2) { font-weight: bold; }

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?

1. You should consider including the :nth-child pseudo-class.


2. You should consider including the :first-child pseudo-class.
3. You should consider including the :last-child pseudo-class.
4. You should consider including the :nth-last-child(n) pseudo-class.

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?”

1. You should consider making changes to the web.config file.


2. You should consider making changes to the machine.config file.
3. You should consider making changes to the app.config file.
4. You should consider making changes to the client.config file.

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.)”

1. NET Entity Data Model Designer


2. Entity Data Model Wizard
3. Update Model Wizard
4. None of the above

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?

1. Web Deployment Package


2. Copy Web Site Tool
3. One-Click Publish
4. Publish Web Site Tool

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?”

1. Web Deployment Package


2. Publish Web Site Tool
3. One-Click Publish
4. Deployment Package Editor

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?”

1. The GET method.


2. The SET method.
3. The PUT method.
4. The POST method.

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?”

1. You should consider making use of the StreamedResponse member.


2. You should consider making use of the Buffered member.
3. You should consider making use of the Streamed member.
4. You should consider making use of the StreamedRequest member.

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?

1. WCF Data Services


2. LINQ to XML
3. NET Entity Framework
4. NET DataSets

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?

1. OleDbConnection and OleDbDataReader


2. SQL Server Data Transformation Services (DTS)
3. EntityTransaction and EntityCommand
4. Office Open XML

Answer :A

93. You need to load flight information provided by Consolidated Messenger. What should you use?

1. OleDbConnection and OleDbDataReader


2. Office Open XML
3. COM interop
4. EntityConnection and

EntityDataReader Answer :A

94. ”Arrange following datatype in order of increasing magnitude sbyte, short, long, int.”

1. sbyte < short < int < long


2. long < short < int < sbyte
3. short < sbyte < int < long
4. short < int < sbyte < long

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

96. ”In C#, by default structs are passed how?”

1. By value.
2. By reference.
3. By address.
4. By memory.

Answer :A

97. What does Dispose method do with connection object?

1. Deletes it from the memory


2. Close the connection
3. Temporary dispose the connection
4. All of the above

Answer :A

98. Which of the following statements is correct about classes and objects in C#.NET?

1. Objects are always nameless.


2. Class is a value type.
3. “Since objects are typically big in size, they are created on the stack.”
4. Objects of smaller size are created on the heap.

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

1. Contents of the two objects created will be exactly same.


2. Contents of s1 and s2 will be exactly same.
3. The two objects will get created on the stack.
4. The two objects will always be created in adjacent memory locations.

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

——————————————————————————————————————————————————
——————————————————————————————————————-

Name of Institute:Daffodil Institute Of IT

Course Name: C#

 Microsoft Visual C# is Microsoft’s powerful, language

1. component-oriented
2. non-procedural language
3. declarative
4. none

Answer : A

 _ are basic organization component of visual studio

1. Projects
2. Solutions
3. None
4. Test

Answer : A

 Related projects are grouped together into

1. Solutions
2. Assemblies
3. Executables
4. namespaces

Answer : A

 Solutions cannot contain projects of different types and languages

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

 Which one correct definition of a statement?

1. a command to perform an actions


2. the rules to write statements in a particular programming language
3. the specification of what statements do
4. None

Answer : A

 Which one correct definition of syntax?

1. the rules to write statements in a particular programming language


2. a command to perform an actions
3. the specification of what statements do
4. None

Answer : A

 Which one correct definition of semantics?

1. the specification of what statements do


2. the rules to write statements in a particular programming language
3. a command to perform an actions
4. None

Answer : A

10 Which of the following is are valid identifiers in C#?


1. Counter1
2. 1stnumber
3. $payRate
4. class

Answer : A

11 Which one defines Definite Assignment Rule in C#?

1. C# does not allow us to use an unassigned variable


2. C# does not allow declaring variable inside a method
3. C# does not allow us to use variable outside a method
4. C# does not require Definite Assignment

Answer : A

12 What is a Method?

1. A named sequence of statement


2. A decision statement
3. An iteration structure

D.It is member of a class not of an object

Answer : A

13 Which of the following encloses method body?

1. {}
2. ()
3. Begin End
4. []

Answer : A

14 you want a method to return information,

1. you must write a return statement inside the method


2. you must capture it
3. you must add void keyword as return type
4. all of the above

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

16 A variable declared inside a method is called a

1. local variable
2. global variable
3. member variable
4. instance variable

Answer : A

17 Which one is a read-only property?

1. The property that contains only get block


2. The property that contains only set block
3. The property that contains both get and set block
4. None of the above

Answer : A

18 Which one correctly defines a Boolean operator?

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

20 What is a sentinel variable?

1. The variable in a loop controls the number of iterations that it performs


2. This variable which changed inside the loop
3. The variable whose value causes a loop to exit early
4. None

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

1. using exceptions and exception handlers


2. using checked and unchecked operations
3. using error handler
4. none

Answer : A

22 What is the purpose of catch handler in an exception handling mechanism?

1. to catch and handle a specific type of exception


2. to prevent program from crushing1+l
3. to report about errors
4. to runtime to trap data

loss 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

24 The throw statement needs object to throw.

1. an exception an error
2. a System.object type
3. A disposable type

Answer : A

25 All integer arithmetic in a statement always throws an OverflowException

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

27 What do you do when you design a class?

1. you systematically arrange information into a meaningful entity


2. you group information for global access
3. you protect your information from being altered
4. you write statemnts to manipulate information from database

Answer : A

28 Encapsulation is sometimes referred to as

1. information hiding
2. grouping
3. abstraction
4. polymorphism

Answer : A

29 Which keyword is used to create new instance of a class?

1. new
2. create
3. open
4. object

Answer : A

30 What happens if you do no write any constructor for your class?

1. Compilers generate a default constructor for you


2. You cannot create objects from the class
3. You class does not compile
4. You class is treated as a structure
Answer : A

31 A static class can contain both static and non-static members.

1. FALSE
2. True
3. Both
4. None

Answer : A

32 What is an array?

1. Ordered sequence of elements


2. Unordered sequence of elements
3. Random sequence of element
4. None of the above

Answer : A

33 Arrays are , regardless of the type of their elements.

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

1. The compiler throws an IndexOutOfRangeException


2. Null is returned
3. 0 value is returned
4. Nothing hppenns

Answer : A

35 Where the collection classes are live in?

1. In System. Collections namespace & sub-namespace


2. In System. Collection
3. In .NET Frame work
4. In system

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

37 The class implements a first-in, first-out (FIFO) mechanism

1. Queue
2. Stack
3. Hashtable
4. ArrayList

Answer : A

38 The class implements a last-in, first-out (LIFO) mechanism

1. Stack
2. Hashtable
3. Queue
4. ArrayList

Answer : A

39 The class is often called associative array

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

41 What is a property of a class?


1. A property is a cross between a field and a method
2. A property is a cross between a field and the constructor
3. A property is a bridge between a field and its consumer
4. None of the above

Answer : A

42 looks like a field but acts like a method

1. A Property
2. A method

1. public field
2. An Event

Answer : A

43 A is a command that performs an action

1. statement
2. variable
3. syntax
4. code

Answer : A

44 Value types are some time called _

1. direct type
2. indirect type
3. structures
4. enumerations

Answer : A

45 Reference types are some time called

1. indirect type
2. structures
3. enumerations
4. direct type

Answer : A

46 Converting a value type into reference type is called


1. boxing
2. casting
3. explicit casting
4. unboxing

Answer : A

47 Converting a reference type into value type is called

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

50 What is a variadic method?

1. a method that takes a variable number of arguments


2. a method that takes a fixed number of arguments
3. a method that returns only value types
4. a method that returns a variable type of

information Answer : A

51 The inherits from the base class.

1. Derived class
2. Child class
3. New calss
4. System.Object class

Answer : A

52 Which keyword is used to prevent a class from being inherited?

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

54 A method that is intended to be overridden is called 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

57 Which symbol precedes before the destructor in a class?

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?

1. by creating a disposal method


2. by defining destructors
3. by overriding ,finalize me
4. None of the above

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

62 Which type of operator operates on just one operand?

1. Unary operator
2. Binary operator
3. Trinary Operator
4. None of the above

Answer : A

63 Which type of operator operates on two operands?

1. Binary operator
2. Unary operator
3. Trinary Operator
4. None of the above

Answer : A

64 Which operator you cannot overload?

1. Dot (.)
2. Equality (==)
3. Increment (++)
4. Plus (+)

Answer : A

65 Which one is implicit casting?

1. double d; int a = 20; d = a;


2. int a; double d=2.33; a = (int)d
3. int a = Convert.ToDouble( “20.33”);
4. None of the above

Answer : A

66 Which one is explicit casting?

2. int a; double d=2.33; a = (int)d


3. double d; int a = 20; d = a;
4. int a = Convert.ToDouble( “20.33”);
5. None of the above
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

68 Which is the statement for running an application form?

1. Application.Run( Form instance);


2. System.Run(Form instance);
3. Form.Run(Form instance);
4. None of the above

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?.

1. To release unmanaged resources as quickly as possible


2. To close the form
3. To hide the form
4. None of the above

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

75 Which one is used create Menu?

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

78 What is a “common-dialog”?

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

C.Some common GUI design guide lines

1. None of the above

Answer : A

79 Which is the purpose data validation?

1. To enusure that data entered by a user matches business rules


2. To ensure data is correctly processed
3. To ensure output produced by the application is in correct format
4. All of the above

Answer : A

80 Which property indicates whether a control raises validation event or not?

1. CausesValidation
2. Validation
3. Validate
4. Check

Answer : A

81 What is the default value of CauseValidation?

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?

1. <%: Model.FirstName %>


2. <%= Model.FirstName %>
3. <% Response.Write(Model.FirstName); %>

D.<% Response.Write(HttpUtility.HtmlDecode(Model.FirstName)); %>

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?

1. the Web Deployment tool


2. the Copy Web Site tool
3. the Publish Web Site utility
4. the XCOPY command-line tool

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

95 Which of the following is a reference type?.

1. string
2. Boolean
3. int
4. Char

Answer : A

96 Which of the following constitutes the .NET Framework?

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

98 Which of the following is not a .NET compatible language?

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?

1. Sample s = new Sample();


2. Sample s;
3. s = new Sample();
4. public int 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#
1. Which is the correct output for the following code snippet?

classProgram

staticvoid Main(string[] args)

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 s1 = “ALL MEN ARE CREATED EQUAL”;

String s2;

s2 = s1.Substring(12, 3);

Console.WriteLine(s2);

1. ARE B. CRE C. CR D. REA

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

4. What is the output of the following code snippet?

classProgram

publicstaticvoid Main(string[] args)

Console.WriteLine(10 + 20 / 5);

Console.ReadKey();

1. 6 B. 14 C. Both A and B D. None of above

Correct answer: B

5. Which one is false for static class?

1. Static method used after creating an object of static class.


2. Static members belong to the class, rather than an instance.
3. Shared by all instance of the class
4. Classes can have static members, such as properties, methods and variables.

Correct Answer: A

6. Which of the following statements is not TRUE about the .NET CLR?

1. It provides a language-neutral development & execution environment.


2. It ensures that an application would not be able to access memory that it is not authorized to access.
3. It provides services to run “managed” applications.
4. It provides services to run “unmanaged” applications.
Answer: D

7. Which of the following statement is not correct

1. Program execution begins at Main()


2. The using keyword refers to resources in the .NET framework class library
3. A program is made up of many separate statement
4. Statement are separated by a colon

Answer: D

8. Which of the following statements is correct about Managed Code?

1. Managed code is the code that is compiled by the JIT compilers.


2. Managed code is the code where resources are Garbage Collected.
3. Managed code is the code that runs on top of Windows.
4. Managed code is the code that is written to target the services of the CLR.

Correct Answer: D

9. Which of the following .NET components can be used to remove unused references from the managed heap?

1. Common Language Infrastructure


2. CLR
3. Garbage Collector
4. Class Loader

Correct Answer: C

10. Which of the following statement is not correct for 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

13. What is the output of the following code snippet?

namespace mahedee.net

classProgram

staticvoid Main(string[] args)

Console.WriteLine(“Size of int: {0}”, sizeof(int));

Console.ReadLine();

1. Size of int: 8
2. Size of int: 4
3. Size of int: {0}
4. Error

Answer: B

14. Which of the following are NOT Relational operators in C#.NET?

1. >=
2. !=
3. <=
4. <>=
Answer: D

15. What is the output of the following code snippet?

classProgram

staticvoid Main(string[] args)

int d;

d = Convert.ToInt32(!(50 < 21));

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

17. Which of the following is not Logical operators in C#.NET?

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

Console.WriteLine( ++num + z++ + ” ” + ++z );

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;

output = !(a > b);

1. An error will be reported since !can work only with an int.


2. 1
3. True
4. False

Answer: C

20. Which of the following statements is correct?

1. A constructor used to initialized an object


2. C# provides a copy constructor.
3. Destructors are used with classes as well as structures.
4. A class can have more than one destructor.

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

22. Can static procedures access instance data?

1. Yes No

Answer: B

23. Which of the following statements are not correct about constructors in C#.NET?

1. Constructors cannot be overloaded.


2. Constructors always have the name same as the name of the class.
3. Constructors are never called explicitly.
4. Constructors never return any value.

Answer: A

24. How many times can a constructor be called during lifetime of the object?

1. As many times as we call it.


2. Only once.
3. Depends upon a Project Setting made in Visual Studio.NET.
4. Any number of times before the object gets garbage collected.

Answer: B

25. Is it possible to invoke Garbage Collector explicitly?

1. Yes No

Answer: A

26. Which of the following statements is correct?

1. There is one garbage collector per program running in memory.


2. There is one common garbage collector for all programs.
3. An object is destroyed by the garbage collector when only one reference refers to it.
4. We have to specifically run the garbage collector after executing Visual

Studio.NET. Answer: B

27. Which of the following statements are correct about static functions?

1. Static functions are invoked using objects of a class.


2. Static functions can access static data as well as instance data.
3. Static functions are outside the class scope.
4. Static functions are invoked using class.

Answer: D

28. What is the output of the following code snippet?

namespace ConsoleApplication1

classSample

static Sample()

Console.Write(“Static Constructor “);

publicstaticvoid Display()

Console.Write(“Static Method “);

classMyProgram

{
staticvoid Main(string[] args)

Sample.Display();

1. Static Constructor Static Method


2. Static Method
3. Static Constructor
4. Static Method Static

Constructor Answer: A

29. Which of the following statements is correct about constructors in C#.NET?

1. A constructor cannot be declared as private.


2. A constructor cannot be overloaded.
3. A constructor can be a static constructor.
4. A constructor cannot access static data.

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

staticvoid Main(string[] args)

stringstr = “Hello Bangladesh!”;

Console.WriteLine(String.Compare(str, “Hello Bangladesh?”).GetType());

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

36. Which of the following statements about a String is correct?

1. A String is created on the stack.


2. A String is a primitive.
3. A String can be created by using the statement String s1 = new String;
4. A String is created on the heap.

Answer: D
37. Which of the following statement is correct about a String in C#.NET?

1. A String is mutable because it can be modified once it has been created.


2. Methods of the String class can be used to modify the string.
3. A number CANNOT be represented in the form of a String.
4. A String has a zero-based index.

Answer: D

38. Which of the following will be the correct output for the C#.NET code snippet given below?

String s1 = “Five Star”;

String s2 = “FIVE STAR”;

int c;

c = s1.CompareTo(s2);

Console.WriteLine(c);

1. 0 B. 1
2. 2 D. -1

Answer: D

39. A property can be declared inside a class, struct, Interface.

1. True B. False

Answer: A

40. Which of the following statements is correct about properties used in C#.NET?

1. A property can simultaneously be read only or write only.


2. A property can be either read only or write only.
3. A write only property will have only get accessor.
4. A write only property will always return a value.

Answer: B

41. A property can be declared inside a namespace or a procedure.


42. True B. False

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

43. Which of the following statements is correct?

1. Static methods can be a virtual method.


2. Abstract methods can be a virtual method.
3. It is necessary to override a virtual method.
4. When overriding a method, the names and type signatures of the override method must be the same as the virtual
method that is being overriden.

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

46. Which of the following statements is correct?

1. Only one object can be created from an abstract class.


2. By default methods are virtual.
3. If a derived class does not provide its own version of virtual method then the one in the base class is used.
4. Each derived class does not have its own version of a virtual method.

Answer: C
47. Which of the following are necessary for Run-time Polymorphism?

1. The overridden base method must be virtual, abstract or override.


2. Both the override method and the virtual method must have the same access level modifier.
3. An abstract method is implicitly a virtual method.
4. All of above

Answer: D

48. Which of the following is an 8-byte Integer?

1. Long
2. Short
3. Byte
4. Integer

Answer: A

49. Which of the following is not value types?

1. Integer
2. Single
3. String
4. Long

Answer: C

50. What is the size of a Decimal?

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. A function cannot be called from a subroutine.

1. The ref keyword causes arguments to be passed by reference.

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.

1. Functions and subroutines can be called recursively.

Answer: A

55. Which of the following will be the correct output for the C#.NET program given below?

namespace mahedee.net

classSampleProgram

staticvoid Main(string[] args)


{

int a = 5;

int s = 0, c = 0;

Proc(a, ref s, ref c);

Console.WriteLine(s + ” ” + c);

staticvoidProc(int x, refintss, refint cc)

ss = x * x;

cc = x * x * x;

1. 00
2. 25 25
3. 125 125
4. 25 125

Answer: D

56. How many values is a function capable of returning?

1. 1
2. 0
3. Depends upon how many params arguments does it use.
4. Any number of values.

Answer: A

57. A function can be used in an expression, whereas a subroutine cannot be.

1. True B. False
Answer: A

58. What is the output of the following code snippet?

namespace mahedee.net

classSampleProgram

staticvoid Main(string[] args)

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;

125. It will output 25 125.


126. It will output 25 0.
127. It will output 0 125.
128. Compilation Error
Answer: D

59. What will be the output of the C#.NET code snippet given below?

namespace mahedee.net

classSampleProgram

staticvoid Main(string[] args)

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

60. Which of the following is false for Inheritance mechanism?

1. Use the existing functionality of base class.


2. Override the existing functionality of base class.
3. Implement new functionality in the derived class.
4. Implement containership.

Answer: D

61. What will be the output of the C#.NET code snippet given below?

namespace mahedee.net

classBaseclass

publicvoid fun()

Console.Write(“Base class” + ” “);

classDerived1 : Baseclass

newvoid fun()
{

Console.Write(“Derived1 class” + ” “);

classDerived2 : Derived1

newvoid fun()

Console.Write(“Derived2 class” + ” “);

classProgram

publicstaticvoid Main(string[] args)

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?

1. Polymorphism B. Templates
2. Containership D. Encapsulation

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

staticvoid Main(string[] args)

Derived d;

d = newDerived();

d.fun();

d.fun(77);

1. The program gives the output as: Hi Hello Bye

B.The program gives the output as: Bye Hello

C.The program gives the output as: Hi Bye Hello

D.Error in the program

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

65. Which of the following are reuse mechanisms available in C#.NET?

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?

1. Polymorphism B. Containership
2. Encapsulation D. Inheritance

Answer: D

67. How can you prevent inheritance from a class in C#.NET ?

1. Declare the class as shadows.


2. Declare the class as overloads.
3. Declare the class as sealed.
4. Declare the class as override.

Answer: C

68. Which of the following statements is correct about a namespace in C#.NET?

1. Namespaces help us to control the visibility of the elements present in it.


2. A namespace can contain a class but not another namespace.
3. If not mentioned, then the name ‘root’ gets assigned to the namespace.
4. It is necessary to use the using statement to be able to use an element of a namespace.

Answer: A

69. Which of the following statements is correct about namespaces in C#.NET?

5. Namespaces can be nested only up to level 5.


6. A namespace cannot be nested.
7. There is no limit on the number of levels while nesting namespaces.
8. If namespaces are nested, then it is necessary to use using statement while using the elements of the inner namespace.

Answer: C

70. Which of the following statements is correct about a namespace used in C#.NET?

1. Nested namespaces are not allowed.


2. Importing outer namespace imports inner namespace.
3. Nested namespaces are allowed.
4. If nested, the namespaces cannot be split across files.
Answer: Option C

71. Which of the following cannot be declared in an interface?

1. Properties
2. Methods
3. Enumerations
4. Events

Answer: C

72. Which of the following statements is correct about Interfaces used in C#.NET?

1. All interfaces are derived from an Object class.


2. Interfaces can be inherited.
3. All interfaces are derived from an Object interface.
4. Interfaces can contain only method declaration.

Answer: B

73. Which of the following statements is correct about an interface used in C#.NET?

1. If a class implements an interface partially, then it should be an abstract class.


2. A class cannot implement an interface partially.
3. An interface can contain static methods.
4. An interface can contain static data.

Answer: Option A

74. Which of the following statements is correct?

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

1. Properties cannot be declared inside an interface.


2. This is a perfectly workable interface.
3. The properties in the interface must have a body.
4. Subroutine in the interface must have a body.
5. Functions cannot be declared inside an interface.

Answer: B

76. What is the output of the following code snippet?

namespace mahedee.net

classProgram

enumPlanets
{

Mercury = 2437,

Venus = 6095,

Earth = 6378

staticvoid Main(string[] args)

PlanetsaPlanet = Planets.Earth;

switch (aPlanet)

casePlanets.Earth:

Console.WriteLine(“Radius of Earth: ” + Convert.ToInt32(aPlanet));

break;

casePlanets.Venus:

Console.WriteLine(“Radius of Venus: ” + Convert.ToInt32(aPlanet));

break;

casePlanets.Mercury:

Console.WriteLine(“Radius of Mercury: ” + Convert.ToInt32(aPlanet));

break;

default:

Console.WriteLine(“You didn’t choose a planet”);

break;

}
Console.ReadKey();

1. Radius of Venus: 6378


2. Radius of Earth: 6378
3. Radius of Mercury: 6378
4. You didn’t choose a planet

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?

class Student s1, s2; // Here ‘Student’ is a user-defined class.

s1 = new Student();

s2 = new Student();

1. Contents of s1 and s2 will be exactly same.


2. The two objects will get created on the stack.
3. Contents of the two objects created will be exactly same.
4. The two objects will always be created in adjacent memory locations.

Answer: C

79. Which of the following is the correct output of the C#.NET code snippet given below?

int[ , , ] a = new int[ 3, 2, 3 ];

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

81. Which of the following statements is correct about an Exception?

1. It occurs during compilation.


2. It occurs during linking.
3. It occurs at run-time.
4. It occurs during Just-In-Time compilation.

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

static void Main(string[] args)

int index;

intval = 55;
int[] a = new int[5];

try

Console.Write(“Enter a number: “);

index = Convert.ToInt32(Console.ReadLine());

a[index] = val;

catch(FormatException e)

Console.Write(“Bad Format “);

catch(IndexOutOfRangeException e)

Console.Write(“Index out of bounds “);

Console.Write(“Remaining program “);

1. It will output: Bad Format


2. It will output: Remaining program
3. It will output: Index out of bounds
4. It will output: Bad Format Remaining program
5. It will output: Index out of bounds Remaining program

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.

1. True B. False

Answer: Option A

Object Oriented Design Principle

85. In SOLID Object Oriented Principle SRP means?


86. Simple Responsibility Principle
87. Single Repository Principle
88. Single Responsibility Principle
89. Simple Repository Principle

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–

1. Single Responsibility Principle


2. Open-closed Principle
3. Liskov substitution Principle
4. Interface segregation Principle

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

95. is the validation control used for “Pattern matching”

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

97. Which of the following is not View Engine in ASP.NET MVC

1. Razor
2. Spark
3. HTML
4.

Answer: C

98. What is MVC Stands for?


99. Model – View – Condition
100. Model – View – Controller
101. ViewModel – View – Controller
102. Modify – View –

Controller Answer: B

99. Which of the following handle user input in MVC pattern?


100. Model
101. View
102. Controller
103. None

Answer: C
100. Which of the following display data in MVC pattern?
101. Model
102. View
103. Controller
104. None

Answer: B

SQL Server

101. Which of the following is not actually SQL Joining?


102. Inner Join
103. Outer Join
104. Full Outer Join
105. Right Inner Join

Correct Answer: D

102. Which one is not aggregate function in SQL Server?


103. HAVING B. AVG SUM D. COUNT

Correct Answer: A

——————————————————————————————————————————————————
——————————————————————————————————————-

SL Question Correct Answer Wrong Ans-1 W

1 Which of the following is NOT an Arithmetic operator


in C#.NET? ** + –
2 Which of the following are NOT Relational operators
in C#.NET?
<>= >= <
Which of the following is the correct output for the
3 C#.NET code snippet given below?
Console.WriteLine(13 / 2 + ” ” + 13 % 2); 61 6.5 1 6.
4 Which of the following are Logical operators in
C#.NET?
5 Which of the following is NOT an Assignment && Xor %
operator in C#.NET?
A
\= constructor can be used to C#
/= provides a copy D
*
6 Which of the following statements is correct? set default values and limit constructor. cl
instantiation.
7 Is it possible for you to prevent an object from being Yes No
created by using zero argument constructor?
What will be the output of the C#.NET code are
given below?namespace IndiabixConsoleApplication
{
class Sample
{
static Sample()
{
Console.Write(“Sample class “);
}
public static void Bix1()
{
8 Sample class Bix1 method Bix1 method S
Console.Write(“Bix1 method “);
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Sample.Bix1();
}
}
}
9 Which of the following statements is correct about
A constructor can be a static A constructor cannot be A
constructors in C#.NET? constructor. declared as private. o
Which of the following will be the correct output for
the C#.NET code snippet given below?String s1 =
10 “ALL MEN ARE CREATED
EQUAL”; String s2; CRE ARE C
s2 = s1.Substring(12, 3);
Console.WriteLine(s2);
Which of the following will be the correct output for
the C#.NET code snippet given below?String s1 =
11 “Nagpur”;
NagpurMumbai Mumbai N
String s2;
s2 = s1.Insert(6, “Mumbai”);
Console.WriteLine(s2);
If s1 and s2 are references to two strings, then which of
12 the following is the correct way to compare the two s1.Equals(s2) s1 is s2 s1
references?
Which of the following will be the correct output for
the C#.NET code snippet given below?String
13 s1=”Kicit”; 25 36 3
Console.Write(s1.IndexOf(‘c’) + ” “);
Console.Write(s1.Length);
14 Which of the following keyword is used to overload operator opoverload o
user-defined types by defining static member
functions?
Which of the followings is the correct way to overload public static sample operator + public abstract sample p
15 operator + (sample a, sample b
+ operator? ( sample a, sample b ) (
)
16 Which of the following modifier is used when a
virtual method is redefined by a derived class? override overridable o
17 Which of the following is an 8-byte Integer? Long Char S
18 Which of the following is NOT an Integer? Char Short L
19 Which of the following does not store a sign? Byte Single L
20 Which of the following is the correct size of a
Decimal datatype? 16 Bytes 10 Bytes 4
Which of the following is the correct ways to set a
21 value 3.14 in a variable pi such that it cannot be
modified? const float pi = 3.14F; float pi = 3.14F; c
Which of the following should be used to implement a
22 ‘Like a’ or a ‘Kind of’ relationship between two
entities? Inheritance Templates P
23 Which of the following is NOT a .NET Exception
StackMemoryException Exception D
class?
24 Which of the following is the Object Oriented way of
Exceptions OnError H
handling run-time errors?
Exceptions can be thrown even from a constructor,
25 whereas error codes cannot be returned from a TRUE FALSE
constructor.
Which of the following is the correct output of the
26 C#.NET code snippet given below?int[ , , ] a = new int[
3, 2, 3 ]; 18 20 1
Console.WriteLine(a.Length);
27 Which language is not a true object-oriented
VB 6 VB.NET C
programming language?
28 Graphic Use Interaction GUI GI G
Integrated Development
29 What does IDE stand for?
Integrated Design In
Environment Environment E
30 An object is composed of: All ofclass
One the can
above.
create many properties m
31 Which statement about objects is true?
One object can create many O
objects. classes. o
32 The CancelButton property belongs to which object? Form Button L
33 Which is not a common control event? SingleClick DoubleClick C
34 Which is a numeric data type? Integer Char St
35 The Date data type does not hold which type of
Quarters Months D
information.
Can be used anywhere in the
36 A local variable Is declared within a method M
program
represents an attribute of an
37 An instance variable object is an object of a class is
38 Private Button print = new button(); creates a button control initializes a button control b
Represents the behavior of an Represents the attribute of an
39 An instance method object R
object
m
40 A Constructor all of the above is used to create objects
th
Creates the class Test that C
41 class Test: Form { } Creates the class Test : Form
inherits the class Form in
42 A variable declared inside a method is called
a variable Local Static P
43 Defining two methods with the same name but with
Overloading Loading M
different parameters is called.
44 Find any errors in the following BankAccount
constructor: Public int BankAccount() { balance = 0; Return type Name F
}
In the body of a method, C# uses the variable
45 named to refer to the current object whose this Call d
method is being invoked.
46 String mystring; Creates a Object Constructor C
47 Is it possible to pass methods as arguments for other
methods without modification. True FALSE
48 What is the proper header for a class that intends to use
an interface. class MyClass : Iface class MyClass Iface cl
49 To output the value of multidimensional array,
myArray[1][3] myArray[1.3] m
Console.WriteLines( )
50 All methods in an abstract base class must be declared
abstract. False True
51 Methods that are declared abstract in the base class
must show implementation at the time of
declaration. False True
52 A method an exception when that method
detects that a problem has occured.
Throws Catches T
53 A block enclose the code that could throw an
exception.
Try Catch E
54 The proper way to convert a string to all lowercase is: string.ToLower() string.ToLower(string) T
55 Is it possible to change the value of a variable while
debugging a C# application? Yes No B
56 Which of the following validation control is used to
ensure that an user does not skip a form entity
field? RequiredFieldValidator CompareValidator R
57 Which type of validation is used to check password and
confirm password in a login form? CompareValidator CustomValidator R
58 Two methods with the same name but with different
Overloading Loading M
parameters.
59 Which of the following characters ends every C#
statement? Semicolon (;) Period (.) C
60 Strings are types Reference Value D
Select Case (…expression…)
61 what are the valid DataTypes in SelectCase Above all Integer ch
(expression) Statement?
62 The base class for all classes in .NET Framework is:
System.Object System.Nullable S
63 specifies how a member is accessible Encapsulation Polymorphism In
outside the class.
64 A function can return more than one value. False True
65 If a function returns no value, the return type must be
declared as void. True FALSE
In C#, a function needs to be defined using the static
66 keyword, so that it can be called from the Main
function. True FALSE
67 In a function, The return statement is not required if the
return type is anything other than void. False True
68 A local variable declared in a function is not usable out
side that function. TRUE FALSE
A function can have more than one parameter. Values
69 of the parameters are passed to the function when it is TRUE FALSE
called.
in C#, A function can be overloaded. Overloading a
70 function means you can give the same name to TRUE FALSE
many function, but different in their arguments.
71 A constructor of structure is used to initialize the
variables of the structure. TRUE FALSE
72 The break command is used to exit a loop. TRUE FALSE
for(i=0;i<10;i++) fo
73 Which of the followings is not a nested loop? Console.Write(“i={0}”,i); for(i=0;i<10;i++) w
for(j=1;j<i+2;j++) for(j=1;j<i+2;j++) {
Console.Write(“j={0}”,j); j+
What would be the output from the following C# code
segment? 10 10
9 9
x=10; 9 8
74 while(x>5){ 8 8
7 7
Console.WriteLine(“{0}”,x); 7 6
6
x–; 6 5 5
}
What would be printed from the following C# code
segment?
for(x=1;x<=5;x++){ 12 1245 3
75 if(x==3) break;
Console.Write(“{0}”,x);
}
76 What would be printed from the following C# code 1245 12345 1
segment? for(x=1;x<=5;x+
+){ if(x==3) continue;
Console.Write(“{0}”,x);
}
77 Which of the following is not the component of .Net Common Language Run
Component Network .N
framework? time(CLR)
78 Following is/are the Integrated Development
Both Visual Studio 2010 (VS) V
Environment (IDE) for C#.
A C# program may consist of the following parts.i)
Namespace declarationii) Class methods
79 iii) A main method
All i, ii, iii and iv i, ii and iii only ii,

iv) Statement & Expressions


80is a name which can be used to
identify a class, variable, function etc. Identifier Keyword R
……………….. conversions are performed by C#
81 compiler itself and..............................conversions are
Implicit type, Explicit type Explicit type, Implicit type E
performed by users by using predefined functions.
82 A variable can be declared by using which of the
following syntax?
<data_type> <variable_list>; <data_type> <> <
…………………… access specifier allows a class to
83 expose it’s member variables and member functions to
other functions and objects in the current application. Internal Protected P
84 How much Bytes are stored by ‘Long’ Datatype in
C# .net?
85 Correct way to assign values to variable ‘c’ when 8 4 2
int a=12, float b=3.5,int c;
86 Select a convenient deceleration and initializing of
a floating point number: c = a + convert.ToInt32(b); c = a + b; c
float somevariable = (float) fl
float somevariable = 12.502D
12.502D 1
87 Valid Size of float datatype is ? 4 Bytes 10 Bytes 6
88 What is Size of ‘Char’ datatype? 16 bit 8 bit 1
89 Implicit Conversion’ follows the order of conversion as
per compatibility of datatype as : char > int > float float > char > int in
90 The correct way of incrementing the operators are : c += 1 ++ a ++ b
91 Which are conditional operators ? ?: ‘:?’ ?;
92 Correct way of declaration of object of following
class is ?class name name n = new name(); n = name(); n
93 The data members of a class by default are ? private protected,public pr
94 Which of these method of class String is used to obtain
length() get() Si
length of String object?
95 How to print \\ on the screen? Console.WriteLine(“\\\\”); Console.WriteLine(“\\”); C
96 Which keyword is used to declare a base class method virtual This o
while performing overidding of base class methods?
97 Does C#.NET supports partial implementation of
interfaces? FALSE TRUE C
98 Which of these clause will be executed even if no
finally Throws th
exceptions are found?
99 Select the namespace on which the stream classes are
defined? System.IO System.Input S
100 Select the namespace on which the
SqlDataReader classes are defined?
System.Data.SqlClients System.IO S

……………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………

SL Question Correct Answer Wrong Ans-1 Wrong Ans-2


1 Microsoft Visual C# is Microsoft’s
powerful, language component-oriented non-procedural language declarative
2 _ are basic organization component of
visual studio
Related projects are grouped together Projects Solutions none
3
into
4 Solutions cannot contain projects of solutions assemblies executables
different types and languages
A variable is a memory
FALSE A variable is a statement
TRUE A variable is a conditio
Both
5 What is a variable? area where you can store that instructs to perform
defines alternative acti
value which can be different actions at
value stored in it
manipulated later different context
Which special variable holds the value
6 assigned to the set accessor of a value data args
property?
7 Which one correct definition of a the rules to write
statement? a command to perform an the specification of wh
statements in a particular
actions do
programming language
8 Which one correct definition of syntax? the rules to write statements
a command to perform an the specification of wh
in a particular
actions do
programming language
9 Which one correct definition of the specification of what the rules to write a command to perform
statements in a
semantics? statements do particular programming
language
Which of the following is are valid
10 identifiers in C#? Counter1 1stnumber $payRate

Which one defines Definite Assignment


C# does not allow us to use C# does not allow C# does not allow us to
Rule in C#? declaring variable inside a
11 an unassigned variable outside a method
method
12 A named sequence of
What is a Method? statement A decision statement An iteration structure
13 Which of the following encloses method
body? {} () Begin End
14 you want a method to return
information, you must write a return statement you must add void key
you must capture it return type
If a variable can be used at a particular inside the method
15 location in a program, the variable is scope boundary variable
said to be in at that location
16 A variable declared inside a method is
called a local variable global variable member variable
The property that contains
17 Which one is a read-only property? The property that contains The property that conta
only get block only set block and set block
A Boolean operator is an A Boolean operator always
18 Which one correctly defines a Boolean operator that performs a operates on Boolean values A Boolean operator is
operator? calculation whose result and produces a Boolean control a loop
is either true or false value as result
Consider the following statement
19 remainder = remainder %n which one remainder %= n remainder =% n remainder = n%
is equivalent to the above expression
The variable in a loop This variable which The variable whose val
20 What is a sentinel variable? controls the number of
changed inside the loop loop to exit early
iterations that it performs
C# makes it easy to separate the error
21 handling code from the code that using exceptions and using checked and
implements the main flow of the using error handler
exception handlers unchecked operations
program by
22 What is the purpose of catch handler in
to catch and handle a to prevent program from to report about errors to
an exception handling mechanism? specific type of exception crushing1+l
The runtime throws an
23 What happens if any statement inside a The runtime throws an exception and transfers The runtime throws an
exception and transfers
try block generates error? control to the finally block control directly to the first and stops the execution
matching catch handler
The throw statement needs
24 an exception an error a System.object type
object to throw.
25 All integer arithmetic in a checked unchecked loop
statement always throws an
OverflowException
provide a convenient
26 mechanism for modeling the entities Classes Objects Namespaces
manipulated by applications.
What do you do when you design
a you systematically arrange you group information for you protect your inform
class? information into a
27 global access being altered
meaningful entity
28 Encapsulation is sometimes referred to
as information hiding grouping abstraction
29 Which keyword is used to create new
instance of a class?
new create open
30 What happens if you do no write any
Compilers generate a default You cannot create objects You class does not com
constructor for your class? constructor for you from the class
31 A static class can contain both static and
non-static members. FALSE TRUE Both
32 Ordered sequence of Unordered sequence of
What is an array? Random sequence of el
elements elements
33 Arrays are , regardless of the
type of their elements. value type reference type integral type
What happens If you specify an index
34 that is less than 0 or greater than or The compiler throws an
equal to the length of the array Null is returned 0 value is returned
IndexOutOfRangeException
In System. Collections
35 Where the collection classes are live in? namespace & sub- In System. Collection In .NET Frame work
namespace
36 The basic collection classes accept, hold,
and return their elements as objects integers value types
37 The class implements a first-in,
first-out (FIFO) mechanism Queue Stack Hashtable
38 The class implements a last-in,
first-out (LIFO) mechanism
The class is often called Stack Hashtable Queue
39
associative array
Calling a method to achieve the effect Hashtable Stack ArrayList
40 on a field feels a little clumsy. What
then does alleviate this awkwardness?
Properties Events Constructors
A property is a cross A property is a cross
A property is a bridge
41 What is a property of a class? between a field and between a field and the
field and its consumer
a method constructor
42 looks like a field but
acts like a method A Property A method public field
43 A is a command that
performs an action statement variable syntax
44 Value types are some time called _ direct type indirect type structures
45 Reference types are some time called indirect type structures enumerations
46 Converting a value type into reference
type is called boxing casting explicit casting
47 Converting a reference type into value
type is called
unboxing casting boxing
Consider the statement
48 System.Windows.Forms.TextBoxt;What null nothing 0
value does the reference t hold?
is the technical term for
49 declaring two or more methods with Overloading Overriding Inheritance
the same name in the same scope
a method that takes a
a method that takes a a method that returns o
50 What is a variadic method? variable number of
fixed number of types
arguments
arguments
51 The inherits from the base
class. Derived class Child class New calss
52 Which keyword is used to prevent
a class from being inherited?
Which keyword do you use to refer a sealed static void
53 base class’s member from the derived
class? base this parent
54 A method that is intended to be
overridden is called a virtual method new method null method
What do you call the concept “providing
55 different implementations of the base
class’s method in a derived class”? A. Overriding casting A. Hiding
56 Which class does not allow
creating create instances of it? Abstract class Sealed class Interface class
57 Which symbol precedes before the
destructor in a class?
process of destroying an object and A tilde (~) A hash(#) A pipe(|)
58 returning memory back to the heap is
known as Garbage collection Memory management Resource collection
59 How can you release the resource by creating a disposal
yourself as quickly as possible? by defining destructors by overriding ,finalize
The statement provides a clean method
60 mechanism for controlling the lifetimes using switch do
of resources
Which one defines whether the operator
61 evaluates from left to right or from Operator associativity Operator precedence Operator overloading
right to left?
62 Which type of operator operates on
just one operand? Unary operator Binary operator Trinary Operator
63 Which type of operator operates on two Binary operator Unary operator Trinary Operator
operands?
64 Which operator you cannot overload? Dot (.) Equality (==) Increment (++)
int a; double d=2.33; a =
65 Which one is implicit casting? double d; int a = 20; d = a; int a =
(int)d Convert.ToDouble( “2
int a; double d=2.33; a = int a =
66 Which one is explicit casting? double d; int a = 20; d = a;
(int)d Convert.ToDouble( “2
Which property of a windows form
67 should you change to set the text Text Title TitleText
shown on the title bar?
68 Which is the statement for running an Application.Run( Form System.Run(Form
application form? Form.Run(Form instan
instance); instance);
69 Which property of a form can be used to
control the level of transparency? Opacity BackColor Transparency
70 Which property of a form returns the
control that is currently in focus? ActiveControl CurrentControl FocusedControl
What is the purpose of the implemented
To release unmanaged
71 Dispose method in windows form resources as quickly as To close the form To hide the form
control?. possible
Which visual studio generated method
instantiate all controls you added to a
form and set their properties, wires event InitializeComponent Initialize InitializeContols
72
handler with controls?
73 Which event is raised just before a
windows form is actually closed? FormClosing Closing Disposing
74 What is the return type of the
static method Show the
MessageBox? DialogResult ButtonState string
75 Which one is used create Menu? MenuStrip MainMenu Menu
Which property of a menu item is used
76 to show a text as tip when the user ToolTip ContextMenu ToolText
hovers the mouse over the menu item?
What do you call the menu which is
77 shown when users right-clock on a Pop-up menu DropdownMenu Menu
control?.
Some common and standard
dialog boxes supplied with Some common controls
Some common GUI de
78 What is a “common-dialog”? windows OS that can be that are share between two
lines
used with your own or more applications
applications
To enusure that data entered
To ensure data is correctly To ensure output produ
79 Which is the purpose data validation? by a user matches business
processed application is in correc
rules
80 Which property indicates whether a
control raises validation event or not? CausesValidation Validation Validate
81 What is the default value of true false 0
CauseValidation?
82 The Validated occurs
Validating. After Before None
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 ContentPlaceHolder Content PlaceHolder
83
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?
You are developing an ASP.NET MVC
2 application. A view contains a form
that allows users to submit their first <%
84 name. You need to display the value that <%: Model.FirstName %> <%= Model.FirstName %> Response.Write(Model
is submitted, and you must ensure that %>
your code avoids crosssite scripting.
Which code segment should you use?
You are deploying an ASP.NET Web
application to a remote server. You need
to choose a deployment method that will
85 ensure that all IIS settings, in addition to the Web Deployment tool the Copy Web Site tool the Publish Web Site u
the Web content, will deploy to the
remote server. Which deployment
method should you choose?
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
86 template with the following
markup.<asp:Label runat=”server” OnDataBinding OnLoad Construct
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?
You are developing an ASP.NET Web
page that will display the median value
from a sequence of integer values. You
87 need to create an extension method to
compute the median value. Which IEnumerable<T> IComparer<T> IEnumerator<T>
interface should you add the extension
method to?
88 How to change the image of an image
control place in each row in a ItemDataBound Init Prerender
gridview
Which directive defines master page-
89 precise attributes that are used by the @ Master @ MasterType @ PageType
ASP.NET page parser and compiler?
You have to store user data of 200 KB in
90 an object. Which state management Server session Cookie ViewState
technique to use
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
91 information for the self-tracking entities ApplyChanges SaveChanges Refresh
can be used to update the
database.Which ObjectContext method
should you call after changes are made
to the entities?
Which class should you use to manage
92 multiple tables and relationships DataSet DataTable DataView
among them?
In ADO.NET, which class can start an
93 explicit transaction to update a SqlConnection SqlCommand SqlParameter
SQL Server database?
When working with LINQ to SQL, what
94 is the main object that moves data to and DataContext DataSet SqlDataAdapter
from the database?
95 Which of the following is a reference
type?. CLR
string ASP.NET
Boolean Applications Win Form Application
int
96 Which of the following
constitutes the .NET Framework?
97 Which of the following is the root of System. Object System. Type System. Base
the .NET type hierarchy?
98 Which of the following is not a .NET Java C# J#
compatible language?
Which of the following is the correct
99 way to create an object of the class Sample s = new Sample(); Sample s; s = new Sample();
Sample?
Which of the following can be used to
100 terminate a while loop and transfer break exit statement continue
control outside the loop?
SL Question Correct Answer Wrong Ans-1 Wrong Ans-2
1 A variable which is declared inside a
method is called a variable Local Private Static
2 Which of the following are not types of
access modifiers in C#?
3 In data reader, what can be used before external protect internal protect protect
read method?
None Getvalue Getstring
4 An Event has as default return
type
No return type for events String Double
5 What object can help you maintain data
across users?
6 In C#, by default structs are passed Application Object Session object Server Object
how?
allow to By value By reference By address
encapsulate discrete units of
7 functionality and provide a graphical
representation of that functionality to
the user controls object class
8 What does Dispose method do with
connection object? Deletes it from the memory Close the connection Temporary dispose the
9 Which language is not a true object-
oriented programming language?
10 Which is not a main component of the VB 6 VB.NET C++
Visual Studio IDE?
Which are the standard prefixes for the Start Menu Solution Explorer Tool Box
11 Button and Combo box controls
respectively?
btn and cbo btn and chb bto and chb
One class can create many
12 Which statement about objects is true? One object is used to create One class is used to cre
objects one class. object
13 Which property determines whether a
control is displayed to the user? Visible Hide Show
14 Related projects are grouped
together into
15 Consider the statement N= 5; What solutions assemblies executables
type of statement is it?
An assignment statement; it
variable declaration A selection statement
assign value 5 to variable N
16 A named sequence of
What is a Method? statement A decision statement An iteration structure
The of a method
17 describes the types and names of the
information that you can pass into the parameter list return type method name
method for it to process
Consider the following
statement
18 remainder = remainder %n which one is remainder %= n remainder =% n remainder = n%
equivalent to the above expression
19 How many times the loop will repeat? This loop will never
for(inti=1; ;i++) { //code } 0 1
terminate
20 Whatis the purposeof catch handler in an to catch and handle a
to prevent program from to report about errors to
exception handlingmechanism? specifictype of exception crushing1+l
What happens if a try block throws an The program terminates The runtime executes its The runtime exits the tr
own error routine and
21 exception and there is no corresponding with an unhandled exception tries to execute stateme
catch handler? executes next statement immediately after the tr
22 Encapsulation is sometimes referred to
as
information hiding polymorphism abstraction
23 Reference types are some time called
indirect type direct type structures
A user needs to enter a DateTime in a

24 text field. You need to parse the value in DateTime.TryParse DateTime.Parse Convert.ToDateTime
code. Which method do you use?
You are working on a globalized web
application. You need to parse a text decimal.TryParse(value, int.TryParse(value,
25
field where the user enters an amount of NumberStyles.Currency, decimal.TryParse(valu
NumberStyles.Currency,
money. Which method do you use? ServerCulture);
UICulture); UICulture);
26 You need to validate an XML file. What
do you use? XSD JavaScriptSerializer RegEx
Bob and Alice are using an asymmetric Bob sends Alice his public Bob sends Alice his private
algorithm to exchange data. Which key
27
key, and Alice sends Bob key, and Alice sends Bob Bob sends Alice his pri
should they send to the other party to her public key. her public key. and Alice sends Bob he
make this possible?
You are creating a new collection type
28 and you want to make sure the elements
Indexer property Constructor Generic type parameter
in it can be easily accessed. What
should you add to the type?
You are creating a complex query that
29 doesn’t require any particular order and
you want to run it in parallel. Which AsParallel AsSequential AsOrdered
method should you use?
You have received instructions to make You should consider You should consider
sure that IIS errors are handled in bringing the customErrors bringing the customErrors You should consider br
30 accordance with the prerequisites. attribute in the web.config attribute in the customErrors attribute
Which of the following actions should file up to date. machine.config file up to app.config file up to da
you take? date
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
The RegisterGlobalFilters The RegisterLocalFilters
to method. The JoinGlobalFilters
method.
31 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?
32 You have been instructed to make sure You should consider making You should consider You should consider m
that the technical prerequisites with use of the StateServer mode. making use of the In- the Off mode.
regards to scalability are adequately process mode.
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?
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
countries toallows
access for
theusers from various
application based
You should consider making You should consider
33 on their respective cultures. As a result, You should consider m
use of the ViewBag making use of the
the application includes various resource the Html property.
files in the Resources directory. These property. ViewContext property.
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?
You are developing an ASP.NET MVC
application that will be deployed to
servers on multiple networks. The
application must be compatible with
34 multiple browsers. You must track the
page number that the user is viewing in QueryString Session Application
search results. You need to program
the location for storing state
information.
Where should you persist state
information?
You are developing an ASP.NET MVC
web application in Visual Studio 2012.
The application requires several
thousand content files. All content is Combine the content files by Move the content to a s
35 hosted on the same IIS instance as the using ASP.NET MVC Enable compression in IIS.
application. You detect performance bundling. server.
issues when the application starts. You
need to resolve the performance issues.
What should you do?
36 You are developing an ASP.NET MVC Forms Kerberos Basic
application. You need to authenticate
clients by using an ASP.NET
membership database. Which
authentication method should you
implement?
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
37 server failures gracefully. The servers in A state server ASP.NET session state A local database
the farm must share the short-term state
information. You need to persist the
application state during the session.
What should you implement?
You are testing an ASP.NET
application. The test plan requires that
tests run against the application’s
38 business layer. You need to use the test Unit Test Project Web Test Project Load Test Project
project template that meets this
requirement. Which template should you
use?
You are developing an ASP.NET MVC
application. You need to authenticate
39 clients by using NT LAN Manager Windows Basic Forms
(NTLM). Which authentication method
should you implement?
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
40 server failures gracefully. The servers in A state server ASP.NET session state A local database
the farm must share the short-term state
information. You need to persist the
Application state during the session.
What should you implement?
You are developing an ASP.NET MVC
application that will be deployed to
servers on multiple networks. The
application must be compatible with
41 multiple browsers. You must track the
page number that the user is viewing in QueryString Session Application
search results. You need to program
the location for storing state
information.
Where should you persist state
information?
42 You are developing an ASP.NET MVC Combine the content files by Implement HTTP caching Install a second IIS inst
web application in Visual Studio using ASP.NET MVC in the ASP.NET MVC
2012. The application requires several bundling. controllers.
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?
You are developing an HTML5 web
application and are styling text. You
43 need to use the texttransform CSS Lowercase Blink Line-through
property. Which value is valid for the
text-transform property?
You are developing an HTML5 web
application and are styling text. You
44 need to use the texttransform CSS Capitalize Red 20px
property. Which value is valid for the
text-transform property?
You are modifying a blog site to
improve search engine readability. You
45 need to group relevant page content <article> <table> <div>
together to maximize search engine
readability. Which tag should you use?
You are modifying a blog site to
improve search engine readability. You
46 need to group relevant page content <section> <tbody> <div>
together to maximize search engine
readability. Which tag should you use?
You are developing a customer web
form that includes the following
HTML.
<input id=”txtValue”/> You need to <input id=”txtValue”
<input id=”txtValue” <input id=”txtVa!ue” t
47 change the HTML markup so that type=”text”
type=”country”/> pattern-” [A-Za-z] {3}
customers can enter only a valid three- required=”xxx”/>
letter country code. Which HTML
should you use?
You are developing an HTML5 web
application and are styling text. You
48 need to use the text transform CSS Capitalize Hidden Italic
property. Which value is valid for
the text-transform property?
You are developing an HTML5 web
application and are styling text. You
49 need to use the text transform CSS Capitalize Italic Line-through
property. Which value is valid for
the text-transform property?
50 You are modifying a blog site to <article> <tbody> <div>
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?
You are modifying a blog site to
improve search engine readability. You
51 need to group relevant page content <section> <span> <nav>
together to maximize search engine
readability. Which tag should you use?
You are developing an HTML5 web
application and are styling text. You
need to use the text transform CSS
52 property. Which value is valid for the lowercase Red hidden
text-transform property? transform CSS
property. Which value is valid for the
text-transform property?
You are developing an HTML5 web
application and are styling text. You
53 need to use the text transform CSS lowercase 20px line-through
property. Which value is valid for the
text-transform property?
You are developing an HTML5 web
application and are styling text. You
54 need to use the text transform CSS Capitalize Italic Red
property. Which value is valid for the
text-transform property?
You are building an ADO.NET Entity
Framework application. You need to
validate the conceptual schema
definition language (CSDL), store
55 schema definition language (SSDL), and EDM Generator
Entity Data Model Wizard Update Model Wizard
mapping specification language (MSL) (EdmGen.exe)
files. Which Entity Data Model tool
can you use? (Each correct answer
presents a complete solution. Choose
all that apply.)
You are designing an ASP.NET Web
API application. You need to select an
56 HTTP verb to allow blog POST GET DELETE
administrators to moderate a comment.
Which HTTP verb should you use?
57 You are planning to migrate websites Web Deploy RoboCopy Microsoft command-li
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?
You are developing an ASP.NET MVC
application. Applications can be
deployed to remote servers only by
administrators who have elevated
58 privileges. The administrators do not Web Deployment Package Copy Web Site Tool One-Click Publish
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?
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
59 ReadCommitted Serializable Repeatable
data that is locked by other transactions.
You also need to prevent exclusive
range locks. Which isolation level
should you use?
You are developing a WCF service. A
new service instance must be created
for PerSession PerCall Single
60
each client session. You need to choose
an instancing mode. Which instance
mode should you use?
You are developing a WCF service. A
new service instance must be created PerCall Single PerRequest
for
61
each client request. You need to choose
an instancing mode. Which instancing
mode should you use?
You are designing an ASP.NET Web DELETE PUT POST
API application. You need to select an
62
HTTP verb to allow blog
administrators to remove a comment.
Which HTTP verb should you use?
You are developing an ASP.NET MVC Serializable ReadUncommitted Repeatable
application that reads and writes data
63
from a SQL Server database. You need
to maintain data integrity in all
situations that use transactions.
64
You are developing an ASP.NET MVC Web Deployment Package One-Click Publish Publish Web Site Tool
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?
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. PUT GET SET
65
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?
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 The GET method. The SET method. The PUT method.
application using ASP.NET MVC Web
66
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?
You need to recommend a data access
technology to the contractor to retrieve
67
data from the new data source. Which WCF Data Services LINQ to XML ADO.NET Entity Fram
data access technology should you
recommend?
Data provided by Consolidated
Messenger is cached in the Ensure that the
68
HttpContext.Cache object. You need to Use the CacheDependency EffectivePrivateBytesLimit Change the sliding exp
type configured to monitor
ensure that the cache is correctly the SFTP target folder. value is greater than the cache item to 12 hours.
updated when new data arrives. What size of the database file.
should you do?
You need to load flight information SQL Server Data
69 OleDbConnection and EntityTransaction and
provided by Consolidated Messenger. Transformation Services
OleDbDataReader EntityCommand
Which should you use? (DTS)
You need to load flight information OleDbConnection and
70
provided by Consolidated Messenger. Office Open XML COM interop
What should you use? OleDbDataReader
You need to make the “Distance” header
71
of the table bold in the table > tr > th:nth-child(2) table > tr { font-weight: table > th:last-child { f
Views/RunLog/GetLog.cshtml view.
Which code segment should you use? { font-weight: bold; } bold; } bold; }
You need to make all of the rows in
the table bold in the table > tr { font-weight: table > th:last-child { table + first-child { fon
72
Views/RunLog/GetLog.cshtml view. bold; } font- weight: bold; } bold; }
Which code segment should you use?
You need to implement client-side
animations according to the business
73
requirements. Which line of code should $(“body h1:nth- $(“body h1:nth- $(“body h1:nth-
you use? (Each correct answer presents child(1)”).fadeOut(1000); child(1)”).fadeIn(1000); child(1)”).animate({ op
a complete solution. Choose all that
apply.)
You have been instructed to insert a line
of code into your existing code that
allows for the Distance” header of the You should consider You should consider You should consider in
74
table to be displayed in bold in the including the :nth-child including the :first-child the :last-child pseudo-c
Views/CyclingLog/GetLog.cshtml view. pseudo-class. pseudo-class.
Which of the following should be
included in the line of code?
You have been tasked with making sure
that the application is configured to You should consider making You should consider
75
make use of a ustom role provider, You should consider m
changes to the web.config making changes to the
named CyclingLogRoleProvider. Which changes to the app.con
of the following actions should you file. machine.config file.
take?
You are building an ADO.NET Entity
Framework application. You need to
validate the conceptual schema
definition language (CSDL), store
76
schema definition language (SSDL), and ADO.NET Entity Data
Entity Data Model Wizard Update Model Wizard
mapping specification language MSL) Model Designer
files. Which Entity Data Model tool can
you use? (Each correct answer presents
a complete solution. hoose all that
apply.)
You are designing an ASP.NET Web
API application. You need to select an
77
HTTP verb to allow blog POST GET DELETE
administrators to moderate a comment.
Which HTTP verb should you use?
You are planning to migrate websites
from IIS 6 to IIS 7.5. You do not have
78
access to SSH or a VPN. You need to
select a deployment tool to securely Web Deploy RoboCopy Microsoft command-li
migrate the websites. Which tool
should you use?
79
You are developing an ASP.NET MVC Web Deployment Package Copy Web Site Tool One-Click Publish
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?
You develop an ASP.NET MVC
application that is secured by using
SSL. You are ready to deploy the In the Package/Publish
application Create a web publish Extend the
80 settings of the project,
to production. The deployment package pipeline target file with a CopyAllFilesToSingle
must include the installation of the SSL select the All Files in this
custom web deploy target. in the project file.
certificate. You need to configure the project option.
deployment package to meet the
requirement. What should you do?
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
81 ReadCommitted Serializable Repeatable
data that is locked by other transactions.
You also need to prevent exclusive
range locks. Which isolation level
should you use?
You are developing a WCF service. A
new service instance must be created
for PerSession PerCall Multiple
82
each client session. You need to choose
an instancing mode. Which instance
mode should you use?
You are developing a WCF service. A
new service instance must be created PerCall Single PerRequest
for
83
each client request. You need to choose
an instancing mode. Which instancing
mode should you use?
You are designing an ASP.NET Web DELETE PUT POST
API application. You need to select an
84
HTTP verb to allow blog
administrators to remove a comment.
Which HTTP verb should you use?
You are developing an ASP.NET MVC Serializable ReadUncommitted Repeatable
application that reads and writes data
85
from a SQL Server database. You need
to maintain data integrity in all
situations that use transactions.
86
You are developing an ASP.NET MVC Web Deployment Package Publish Web Site Tool One-Click Publish
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?
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. PUT GET SET
87
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?
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 The GET method. The SET method. The PUT method.
application using ASP.NET MVC Web
88
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?
You are employed as a developer at
ABC.com. ABC.com has a single
Active Directory domain, named You should consider making You should consider
ABC.com.
You are in the process of creating
ASP.NET MVC Web API application.
89
You are required to write code that You should consider m
use of the making use of the Buffered
includes a member of the TransferMode the Streamed member.
StreamedResponse member. member.
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?
You need to recommend a data access
technology to the contractor to retrieve
90
data from the new data source. Which WCF Data Services LINQ to XML ADO.NET Entity Fram
data access technology should you
recommend?
91
Data provided by Consolidated Use the CacheDependency Ensure that the Change the sliding exp
Messenger is cached in the
HttpContext.Cache object. You need to type configured to monitor EffectivePrivateBytesLimit
ensure that the cache is correctly the SFTP target folder. value is greater than the cache item to 12 hours.
updated when new data arrives. What size of the database file.
should you do?
You need to load flight information SQL Server Data
92 OleDbConnection and EntityTransaction and
provided by Consolidated Messenger. Transformation Services
OleDbDataReader EntityCommand
Which should you use? (DTS)
You need to load flight information OleDbConnection and
93
provided by Consolidated Messenger. Office Open XML COM interop
What should you use? OleDbDataReader
Arrange following datatype in order of
94
increasing magnitude sbyte, short, sbyte < short < int < long long < short < int < sbyte short < sbyte < int < lo
long, int.
Which statement is correct about ’a’ is a reference to an
95
following c#.NET code? int[] a= {11, object of a class that ’a’ is reference to the ’a’ is a reference to an
3, 5, 9, 6}; compiler drives from array created on stack created on stack
‘System.Array’ class
96
In C#, by default structs are passed
how? By value. By reference. By address.
97
What does Dispose method do with
connection object?
Deletes it from the memory Close the connection Temporary dispose the
Which of the following statements is Objects are always Since objects are typica
98
correct about classes and objects in Class is a value type.
nameless. size, they are created o
C#.NET?
Which of the following statements is
correct about the C#.NET code snippet Contents of the two objects Contents of s1 and s2 will The two objects will ge
99
given below? class Student s1, s2; // ere created will be exactly
be exactly same. the stack.
‘Student’ is a user-defined class.s1 = same.
new Student(); s2 = new Student();
The assemblies provided by Trey Use the ILMerge.exe tool to In the post-build event,
Research must be merged into a single merge the assemblies Use the ILMerge.exe tool Assembly Linker (al.ex
100
assembly. You need to merge the provided by Trey Research, to merge the Trey Research
p sign the application’s
assemblies provided by Trey and then stipulate the output assemblies without
output assembly with t
Research and meet the application must be signed with the stipulating a key
key pair.
specification. What should you do? pair. Trey.snk key pair.
SL Question Correct Answer Wrong Ans-1 Wrong Ans-2
1 How much Bytes are stored by ‘Long’
Datatype in C# .net? 8 4 2
2 Correct way to assign values to
variable ‘c’ when int a=12, float
b=3.5,int c; c = a + convert.ToInt32(b); c = a + b; c = a + int(float(b));
3 Select a convenient deceleration and
float somevariable = (float) float somevariable = float somevariable = (D
initializing of a floating point number: 12.502D 12.502D 12.502D
4 Number of digits upto which precision
value of float datatype is valid ? Upto 7 digit Upto 6 digit Upto 8 digit
5 Valid Size of float datatype is ? 4 Bytes 10 Bytes 6 Bytes
6 What is Size of ‘Char’ datatype? 16 bit 8 bit 12 bit

7 Why string made reference type in To overcome problem


C#.NET ? To reduce size of string To create string on stack
stackoverflow
8 Syntax for declaration and initialization
<data type><var_name> = <datatype><var_name>; <var_name><data type
of data variable is : <Value>;
Boxing’ is the process of ‘Boxing’ is the process of
converting a value type converting a reference In ‘Boxing’ we need e
to type
9 Choose effective differences between the reference type and to value type and conversion and in ‘Unb
‘Boxing’ and ‘Unboxing’. ‘Unboxing’ is the process of ‘Unboxing’ is the process need implicit conversio
converting reference of converting value type to
to value type reference type
Implicit Conversion an
10 Types of ‘Data Conversion’ in C#? Explicit Conversion Implicit Conversion
Conversion
Implicit Conversion’ follows the order
11 of conversion as per compatibility of char > int > float float > char > int int > char > float
datatype as :
Type of Conversion in which compiler
12 is unable to convert the datatype int to uint ushort to long ushort to long
implicitly is ?
13 The correct way of incrementing the
c += 1 #ERROR! b ++ 1
operators are :
14 Which are conditional operators ? ?: ‘:?’ ?;
Arrange the operators in order of
15 increasing as defined in C#: ?: < && < & < != < ++ ?: < && < != < & < ++ ?: < && < != < ++ < &
!=, ?:, &, ++, &&
Which statement is correct of the
mentioned statements?
16 1. The for loop works faster than a while Only 2 is correct Only 1 is correct Both 1 and 2 are correc
loop
2. for( ; ; )implements an infinite loop
while(condition)
17 Correct syntax for while statement is: while(condition){}
{}; while(condition);
{}
18 What is most specified using class
declaration ? type & scope Type scope
Correct way of declaration of object of
19 following class is ?
class name name n = new name(); n = name(); name n = name();
20 The data members of a class by default
are ? private protected,public private,public
21 Which refrence modifier is used to
define reference variable?
22 What is output for following set of Ref & #
expression? int a+= (float) b/= (long)c.
Int Float long
public int cube(int x)
23 Which return statement correctly returns {
public int cube(int x) public int cube(int x)
the output: return (x + x); return (x + x); return (x + x);
}
24 Number of constructors a class can
define of ? Any number 1 2
25 Which method have same name as that
of its class?
26 Operator used to free the memory constructor Delete class
when memory is allocated ?
delete New free
27 What is return type of destructor ? None of the mentioned. Int void
Which of the following string() method
28 are used to compare two strings with Coppy() CopyTo() Compare()
each other?
29 Choose the base class for string()
method : System.String System.Array System.char
30 What is String in C# meant for? Object Variable Character Array
Which of these method of class String is
31 used to compare two String objects for equals() Equals() isequal()
their equality?
Which method returns the string such
that some characters which are
specified Trim() Remove() TrimEnd()
32 to be removed from the end of strings
are removed from string by mentioning
number of characters to be removed?
Which of these method of class String Substring() substring() SubString()
is
33 used to seperate a substring from a
String object?
34 Which of these method of class String is
used to obtain length of String object? length() get() Sizeof()
Which of these method of class String is
35 used to extract a all characters from a Remove() CHARAT() charAt()
String object?
36 How to print \\ on the screen? Console.WriteLine(“\\\\”); Console.WriteLine(“\\”); Console.WriteLine(“\\\
Which of these is used as default
37 specifier for a member of class if no private Public public, within its own c
access specifier is used for it?
What is the process by which we can
38 control what parts of a program can Encapsulation Polymorphism Abstraction
access the members of a class?
39 Keyword used to define call by
reference paramter in C# Ref & out
.NET?
Method in which large or variable
40 number of arguements are handled are parameter arrays Value parameters output parameters
known as:
Which of following keyword used to
change data and behaviour of a base
41 class by replacing a member of a base New Overloads Overrides
class with a
new derived member?
public sample operator +
42 Correct way to overload +operator? All of above public abstract operato
( sample a, sample b) a,sample b)
43 When does structure variable get When no reference refers
destroyed? As variable goes out of the Depends on either it is
to it,it will get garbage
scope using new or without n
Choose correct statements about enum collected
An enum variable cannot An enum variable cannot An enum variable can
44 used in C#.NET? have a protected access have a private access inside a class or a name
modifier modifier
45 Number of levels of inheritance are? 4 5 3
A class member declared protected
46 becomes member of subclass of which static member public member private member
type?
47 Which is correct way to create an Declaring existing class as Declaring existing class Declaring existing clas
object of given class abc?
sealed as override overloads
48 Which form of inheritance is not
supported directly by C# .NET? Multiple inheritance Multilevel inheritance Single inheritance
49 Which of these can be overloaded? Constructors & Methods Constructors Methods
Which keyword is used to declare a base
50 class method while performing virtual This override
overidding of base class methods?
51 Which of given modifiers can be used to
prevent Method overriding? Sealed Static Constant
When we call a constructor method
among different given constructors. We
match the suitable constructor by
52 matching the name of constructor first
then the number and type of parameters Polymorphism Method overriding Inheritance
to decide which constructor to be
overloaded.The process is also known
as?
Which of these keywords is used to refer
53 to member of base class from a sub Base Upper this
class?
54 Which of these operator must be used to
inherit a class? : & ::
A type of class which does not have it’s
55 own objects but acts as a base class for
it’s subclass is known as? Abstract class Static class Sealed class
56 Which of the following keyword used to operator Op opoverload
overload user defined types by defining
static member functions?
public static sample operator public sample operator + public abstract operato
57 Correct method to define + operator is? +(int a, int b) (int a, int b) b)
58 What is vector in operator overloading? data type Class method()
59 Which of these will happen if recursive
infinite loop condition After 10000 executions
method does not have a base case? occurence System gets hangup will be automatically st
Which of these data types is used by
60 operating system to manage the Stack Array Queue
Recursion in Csharp?
61 Choose the keyword which declares
the indexer? This Base super
62 Which statement correctly defines about Interfaces cannot be Interfaces consists of d
None of the mentioned
Interfaces in C#.NET? inherited nature and static metho
A class consists of two interfaces with
each interface consisting of three
63 methods.The class had no instance data 24 bytes 12 bytes 16 bytes
which indicates correct size of object
created from this class?
64 Does C#.NET supports
partial implementation of FALSE TRUE Can’t Say
interfaces?
65 Which of these can be used to fully
abstract a class from its Interfaces Objects Packages
implementation?
66 When no exception is caught thrown at
runtime then who will catch it? CLR Operating System Loader
67 Which of these clause will be
executed even if no exceptions are
found? finally Throws throw
68 Which of these exceptions handles the
ArithmeticException MathException IllegalAccessException
divide by zero error?
69 Which of these class is related to all
the exceptions that are explicitly Throwable Throw Exception
thrown?
It is used to manually
70 What is the use of try & catch? All of the mentioned It helps to fix the errors
handle the exception
71 Which of the keywords used for the
block to be examined for exceptions? Try Catch throw
Once applied and hence further which of
72 the following cannot inspect the applied
Linker ASP.NET Runtime Language compilers
attribute?
73 Which among the following cannot be
a target for a custom attribute? Namespace Enum Event
74 The [Serializable()] attributes gets
inspected at:
Which of the class provides the run time compile time design time
75 operation of reading from and writing to System.Console System.Array System.Output
the console in C#.NET?
Which of the given stream method
76 provides the access to the output console Console.Out Console.In Console.Error
by default in C#.NET?
The number of input methods defined by
77 the stream method Console.In in 3 4 2
C#.NET is?
78 Choose the output return when read()
reads the character from the console? Integer String Char
Which method in Console enables to
79 read individual inputs directly from the
ReadKey() Read() ReadLine()
keyboard in a non line buffered manner?
80 What is output returned by Console if
ReadLine() stores I/O error?
81 Which of these classes are used by Byte /O EXCEPTION ERROR 1 0
streams for input and output operation?
Which of these class is used to create an InputOutputStream InputStream Reader
82 object whose character sequence is
mutable?
83 Select the method used to write single StringBuilder() String() Both of the mentioned
byte to a file?
84 Select the namespace on which the
stream classes are defined? WriteByte() Write() Wrteline()
85 Choose the class on which all stream
classes are defined?
Choose the stream class method System.IO System.Input System.Output
86
which is used to close the connection:
87 Which of these data type is returned by System.IO.stream Sytem.Input.stream System.Output.stream
every method of OutputStream?
Name the property among the following
void close() close() static close()
88 which represents the current position of
the stream.
None of the mentioned int float
From Which of these classes the
89 character based output stream class
Stream Writer is derived? long Length long Position int Length
90 Which of these keywords are used to
implement synchronization?
Which keyword is used for using the
TextWriter TextReader Character Stream
91 synchronization features defined by the
Monitor class?
92 Which method is used to abort thread synchronized Synchronize syn
prior to it’s normal execution?
A thread can exist only in
Lock By multithreading CPU’s By
Synchronized multitasking CPU’s
Monitor
93 Which of these statements is incorrect? idle time is minimized, and
two states, running and minimized, and we can
Abort()
blocked sleep()
we can take maximum terminate()
maximum use of it
use of it
94 Which exception is being thrown if the
URI format is invalid? UriFormatException URLNotFound URLSourceNotFound
Which of these class is used for
95 operating on request from the client to
httpd http httpDecoder
the server?
96 Which among these access
specifiers should be used for main()
method? public Private protected
97 Which among the given class provides
types of rounding functions?
Math Process System
98 Which of these method is a rounding
function of Math class?
99 Which of these class contains only Round() Max() Min()
floating point functions?
Which of these type parameters is used Math Process System
100 for a generic methods to return and
accept any type of object?
T K N
1. CLR is the .Net equivalent of_____.

A. Java Virtual machine


B. Common Language Runtime
C. Common Type System
D. Common Language Specification

Ans: A

2. Abstract class contains_____.

A. Abstract methods
B. Non Abstract methods
C. Both
D. None

Ans: C

3. The default scope for the members of an interface is_____.

A. private
B. public
C. protected
D. internal

Ans: B
4. Which of the following statements is incorrect about delegate?

A. Delegates are reference types.


B. Delegates are object-oriented.
C. Delegates are type-safe.
D. Only one can be called using a delegate.

Ans : D

5. The space required for structure variables is allocated on the stack.

A. True
B. False
C. Maybe
D. Can’t say

Ans: A

6. Which of the following is incorrect about constructors?

A. Defining of constructors can be implicit or explicit.


B. The calling of constructors is explicit.
C. Implicit constructors can be parameterized or parameterless.
D. Explicit constructors can be parameterized or parameterless.

Ans: C

7. Reference is a ___.

A. Copy of class which leads to memory allocation.


B. Copy of class that is not initialized.
C. Pre-defined data type.
D. Copy of class creating by an existing instance.

Ans: D

8. The data members of a class by default are?

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

10. The correct way to overload +operator?

A. public sample operator + (sample a, sample b)


B. public abstract operator + (sample a, sample b)
C. public static operator + (sample a, sample b)
D. all of the mentioned above

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

12. Choose the wrong statement about properties used in C#.Net?

A. Each property consists of accessor as getting and set.


B. A property cannot be either read or write-only.
C. Properties can be used to store and retrieve values to and from the data members of a class.
D. Properties are like actual methods that work like data members.

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

15. What will be the output of the following code snippet?


using System;
class program
{
static void Main(string[] args)
{
int x = 8;
int b = 16;
int c = 64;
x /= c /= b;
Console.WriteLine(x + " " + b+ " " +c);
Console.ReadLine();
}
}

A. 2 16 4
B. 4 8 16
C. 2 4 8
D. 8 16 64
Ans: A

16. Struct’s data members are ___ by default.

A. Protected
B. Public
C. Private
D. Default

Ans: C

17. 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

18. Which of the following statements are correct for C# language?

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

19. What will be the output of the following code snippet?


using System;

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

Q 1 - Which of the following is a reserved keyword in C#?

A - abstract

B - as

C - foreach

D - All of the above.

Answer : D

Explanation

All of the above options are reserved keywords.

Q 2 - Which of the following defines boxing correctly?

A - When a value type is converted to object type, it is called boxing.

B - When an object type is converted to a value type, it is called boxing.


C - Both of the above.

D - None of the above.

Answer : A

Explanation

When a value type is converted to object type, it is called boxing.

Q 3 - Which of the following converts a type to a 16-bit integer in C#?

A - ToDecimal

B - ToDouble

C - ToInt16

D - ToInt32

Answer : C

Explanation

ToInt16() method converts a type to a 16-bit integer.

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

is operator determines whether an object is of a certain type.

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

D - None of the above.

Answer : A

Explanation

Rank gets the rank (number of dimensions) of the Array.

Q 7 - Which of the following is the correct about class member variables?

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.

C - Both of the above.

D - None of the above.

Answer : C

Explanation

Both of the above options are correct.

Q 8 - Dynamic polymorphism is implemented by abstract classes and virtual functions.


A - true

B - false

Answer : A

Explanation

Dynamic polymorphism is implemented by abstract classes and virtual functions.

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.

Q 10 - Which of the following is true about exceptions in C#?

A - The exception classes in C# are mainly directly or indirectly derived from the System.Exception class.

B - C# exceptions are represented by classes.

C - Both of the above.

D - None of the above.

Answer : C

Explanation
Both of the a

1. class represents a collection of TreeNode objects.

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

3. class represents a node of a 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

8. ContextMenuStrip replaces .

A. ContextMenu

B.MenuStrip

C.ToolStrip
D.Menu
Click for answer

A.ContextMenu

bove options are correct.

1. Can the method add() be overloaded in the following ways in C#?

public int add() { }

public float add(){

 A. True
 B. False
 C. None of the mentioned.
 D. None of the Above

 View Answer
 Workspace
 Report
 Discuss

Answer & Explanation

Answer: Option B

2. Which of the following statements is correct about constructors in C#.NET?

 A. A constructor cannot be declared as private


 B. A constructor cannot be overloaded
 C. A constructor can be a static constructor
 D. None of the mentioned

 View Answer
 Workspace
 Report
 Discuss

Answer & Explanation

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

3. Select wrong statement about destructor in C#?

 A. A class can have one destructor only


 B. Destructors cannot be inherited or overloaded
 C. Destructors can have modifiers or parameters
 D. All of above mentioned

 View Answer
 Workspace
 Report
 Discuss

Answer & Explanation

Answer: Option C

Explanatio

5. Which of following statements about objects in “C#” is correct?

 A. Everything you use in C# is an object, including Windows Forms and controls


 B. Objects have methods and events that allow them to perform actions
 C. All objects created from a class will occupy equal number of bytes in memory
 D. All of the mentioned

 View Answer
 Workspace
 Report
 Discuss

Answer & Explanation

Answer: Option D

5. Which of following statements about objects in “C#” is correct?

 A. Everything you use in C# is an object, including Windows Forms and controls


 B. Objects have methods and events that allow them to perform actions
 C. All objects created from a class will occupy equal number of bytes in memory
 D. All of the mentioned

Answer & Explanation

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 & Explanation

Answer: Option D

Explanation:

1. CLR is the .NET equivalent of________.

A. Java Virtual Machine

B. Common Language Runtime

C. Common Type System

D. Common Language Specification

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

3. SOAP stands for_________.

A. Simple Object Access Program

B. Simple Object Access Protocol

C. Simple Object Application Protocol

D. Simple Object Account Protocol

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

6. All C# applications begin execution by calling the_____method.

A. Class()

B. Main()

C. Submain()

D. Namespace

Ans: B

7. A_______is an identifier that denotes a storage location.

A. Constant

B. Reference type

C. Variable

D. Object

Ans: C

8.are reserved, and cannot be used as identifiers.

A. Keywords
B. literal

C. variables

D. Identifiers

Ans: A

9. Boxing converts a value type on the stack to an______on the heap.

A. Bool type

B. Instance type

C. Class type

D. Object type

Ans: D

10. The character pair ?: is a____________available in C#.

A. Unary operator

B. Ternary operator

C. Decision operator

D. Functional operator

Ans: B

11. In C#, all binary operators are______.

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

13. A_____is any valid C# variable ending with a colon.

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

17. Arrays in C# are______objects.

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

20. The formal-parameter-list is always enclosed in______.

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

22. C# does not support_____constructors.

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

24. Struct’s data members are__________by default.

A. Protected

B. Public

C. Private
D. Default

Ans: C

25. A_______creates an object by copying variables from another object.

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

30. Inheritance is______in nature.

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

32. In C#, having unreachable code is always an_____.

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

C. Explicit Interface Implementation

D. Iterative 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

D. None of the above

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.

A. Microsoft visual studio IDE

B. Application window

C. Web forms

D. None of the above

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

43_______methods are not supported for dynamic types.

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

45. COM Interop is simplified in C#4.0 e.g.var doc = Application.GetDocument("MyFile.txt"); In above statement_______
keyword was essential in parameters of GetDocument() in previous versions of C#.

A. out

B.named

C.base

D.ref

Ans: D

46. Covariance and Contravariance are new features introduced in C# 4.0.True/False?

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

48. Duck typing is implemented by using________keyword.

A. dynamic

B.object

C.ref

D.base

Ans: A

49. Web Forms consists of a _______ and a________ .

A. Template, Component

B. CLR, CTS

C. HTML Forms, Web services

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

51. Is it possible to store multiple data types in System.Array?

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?

1.Freeing memory on the stack.

2.Avoiding memory leaks.

3.Freeing memory occupied by unreferenced objects.

4.Closing unclosed database collections.

5.Closing unclosed files.

(A) 1, 2, 3

(B) 1, 4, 5
(C) 3, 5

(D) 3, 4

Ans: B

57. Which of the following statements is correct about Managed Code?

A. Managed code is the code that runs on top of Windows.

B. Managed code is the code that is written to target the services of the CLR.

C. Managed code is the code where resources are Garbage Collected.

D. Managed code is the code that is compiled by the JIT compilers.

Ans: B

58. How does assembly versioning in .NET prevent DLL Hell?

A. The runtime checks to see that only one version of an assembly is on the machine at any one time.

B. The compiler offers compile time checking for backward compatibility.

C. .NET allows assemblies to specify the name AND the version of any assemblies they need to run.

D. It doesn.t.

Ans: C

59. Which of the following is/are not types of arrays in C#?

A. Single-Dimensional

B. Multidimensional

C. Jazzed arrays

D. Jagged arrays
Ans: C

60. A variable which is declared inside a method is called a______variable

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

A. Declaration and initialization is separated

B. It is allocated at compile time

C. It is allocated at runtime

D. all of the above

Ans: D

64. Different ways a method can be overloaded in C#.NET

A. Different parameter data types

B. Different order of parameters

C. Different number of parameters

D. All of above

Ans: D

65. Is it possible to change the value of a variable while debugging a C# application?

A. Yes

B. No

Ans: A

66. Which of the following constitutes the .NET Framework?

1. ASP.NET Applications

2. CLR

3. Framework Class Library


4. WinForm Applications

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;

public Baseclass(int ii)

i = ii;

Console.Write("Base ");

class Derived : Baseclass

public Derived(int ii) : base(ii)


{

Console.Write("Derived ");

class MyProgram

static void Main(string[ ] args)

Derived d = new Derived(10);

A. The program will report an error in the statement base(ii).

B. The program will work correctly if we replace base(ii) with base.Baseclass(ii).

C. The program will output: Base Derived

D. The program will work correctly only if we implement zero-argument constructors in Baseclass as well as Derived
class.

Ans: C

68. Managed methods will be marked as-------------in MSIL code

A. mscorjit

B. cil

C. dgclr

D. None
Ans: B

69. Identify which is true

A. DataView ia subset of row and not columns

B. find can be done only on sorted columns

C. Sorting can be done on multiple columns

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

71. A local variable

A. Can be used anywhere in the program

B. Is declared within a method

C. Must accept a class

D. Represent a class object

Ans: b
72. An instance variable

A. is an object of a class

B. represents an attribute of an object

C. is a method of a class

D. a and c

Ans: b

73. Private Button print = new button();

A. creates a button control

B. initializes a button control

C. instantiates button control

D. a and b

E. a and c

Ans: e

74. An instance method

A. Represents the behavior of an object

B. Represents the attribute of an object

C. Represents another class

D. a and b

Ans: a
75. A Constructor

A. is used to create objects

B. must have the same name as the class it is declared within

C. is a method of a class

D. maybe overloaded

E. b and c

F. all of the above

Ans: e

76. class Test: Form { }

A. Creates the class Test : Form

B. Creates the class Test that inherits the class Form

C. Creates the class form that inherits the class Test

D. a and b

Ans: b

77. A variable declared inside a method is called a______variable

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

A. The result of a users action

B. result of a party

C. code to force users action

Ans: a

83. A delegate defines

A. a Wahsington representative

B. a class that encapsulates methods

C. a means of passing arrays into methods

D. a substitue for an inherited method

Ans: b

84. Is it possible to pass methods as arguments for other methods without modification.

A. True

B. False
Ans: a

85. All interfaces must contain IDrivable

A. True

B. False

Ans: b

86. What is the proper header for a class that intends to use an interface.

A. class MyClass IFace

B. class MyClass ; IFace

C. class MyClass : IFace

D. class MyCalss {IFace}

E. class MyCalss(IFace)

Ans: c

87. In order for a class to use an interface, it must

A. inherit the properties of the interface

B. contain the same methods as the interface

C. create an interface objects

D. a and b

E. all of the above

Ans: e
88. Every class directly or indirectly extends the_____class.

A. System

B. Object

C. Drawing

D. Console

Ans: b

89. The concept of composition specifies that you can.

A. Compose good code with C#

B. Compose C# projects with different objects

C. Reduce errors by remaining composed during programming

D. all of the above

Ans: b

90. Polymorphism occurs when the methods of the child class.

A. Override the parent class methods but maintain the implementation

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

91. To output the value of multidimensional array, Console.WriteLines(___)

A. myArray[1][3];
B. myArray[1.3];

C. myArray{1}{3};

D. myArray(1),(3);

Ans: a

92. All methods in an abstract base class must be declared abstract.

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

94. The code public class B : A { }

A. Defines a class that inherits all the methods of A

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?

A. One constructor takes an argument of type i

B. There is only a default constructor

C. One constructor takes an arguments of the type int

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

98. Exception objects are derived from the class.

A. Try

B. Catch

C. Exception
D. Event

E. System

Ans: c

99. An abstract class

A. may contain instance variables

B. may contain constructors

C. may extend another class

D. a and b

E. all of the above

Ans: e

100. A___block enclose the code that could throw an exception.

A. Try

B. Catch

C. Exception

D. Error

E. a and b

Ans: a

You might also like