C# Programming MCQ

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 156

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
 non-procedural
3 Microsoft’s powerful,  C declarative language
component-oriented none
_____language
 _____ are basic organization
4 A Projects Solutions Test none
component of visual studio
Related projects are grouped
5 A Solutions Assemblies Executables namespaces
together into _____
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 value to perform different defines alternative None
actions at different action based on value
which can be context 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
 Which one correct definition a command to perform statements in a the specification of
9 A particular what statements do None
of a statement? an actions
programming language
the rules to write
statements in a
 Which one correct definition a command to perform the specification of
10 A particular an action what statements do None
of syntax?
programming
language
the rules to write
Which one correct definition the specification of statements in a a command to
11 A particular perform an action None
of semantics? what statements do
programming language
 Which of the following is are
12 A Counter1 1stnumber $payRate class
valid identifiers in C#?
C# does not allow us C# does not allow C# does not allow us C# does not
Which one defines Definite
13 A to use an unassigned declaring variable to use variable require Definite
Assignment Rule in C#? inside a method outside a method
variable 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
Which of the following
15 A {} () Begin End []
encloses method body?
you must write a you must add void
you want a method to return
16 A return statement inside you must capture it keyword as return all of the above
information type
the method
 If a variable can be used at a
particular location in a
17 program, the variable is said C variable boundary scope confined
to be in ________ at that
location
A variable declared inside a
18 D instance variable global variable member variable local variable
method is called a
The property that The property that
 Which one is a read-only The property that None of the
19 A contains only get contains only set block
contains both get and
property? set block above
block
A Boolean operator is A Boolean operator
an operator that always operates on
Which one correctly defines a A Boolean operator is
20 A performs a calculation Boolean values and
used to control a loop None
Boolean operator? produces a Boolean
whose result is either value as result
true or false
Consider the following
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
controls the number of This variable which The variable whose
22 What is a sentinel variable? A changed inside the value causes a loop to None
iterations that it loop exit early
performs
C# makes it easy to separate
the error handling code from using exceptions and using checked and
23 A unchecked operations
using error handler none
the code that implements the exception handlers
main flow  of the program by
 What is the purpose of catch to catch and handle a
to prevent program to runtime to
24 handler in an exception A specific type of from crushing1+l
to report about errors
trap data loss
handling mechanism? exception
The runtime
The runtime throws an The runtime throws an The runtime throws
What happens if any exception and transfers throws an
exception and an exception and
25 statement inside a try block A control directly to the exception and
transfers control to the first matching catch stops the execution of
generates error? program transfers control
finally block handler
to error routine
Ordered sequence of Unordered sequence of Random sequence of None of the
26 What is an array? A elements element
elements above
 Arrays are _______,
27 regardless of the type of their A value type reference type integral type null type
elements.
 What happens If you specify The compiler throws
an index that is less than 0 or an Nothing
28 A Null is returned 0 value is returned
greater than or equal to the IndexOutOfRangeExc happens
length of the array eption
In System. Collections
 Where the collection classes
29 A namespace & sub- In System. Collection In .NET Frame work In system
are live in?
namespace
The basic collection classes
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
 Which operator you cannot
33 A Dot (.) Equality (==) Increment (++) Plus (+)
overload?
int a =
Which one is implicit double d; int a = 20; d int a; double d=2.33; a None of the
34 A = (int)d
Convert.ToDouble( “
casting? = a; 20.33”) above
int a =
int a; double d=2.33; a double d; int a = 20; d None of the
35 Which one is explicit casting? A = a;
Convert.ToDouble( “
= (int)d 20.33”) above
 Which property of a
windows form should you You cannot
36 A Text Title TitleText
change to set the text shown change that
on the title bar?
 Which is the statement for Application.Run( For System.Run(Form Form.Run(Form None of the
37 A instance); instance);
running an application form? m instance); above
 Which one is used create
38 A MenuStrip MainMenu Menu ToolStrip
Menu?
To enusure that data To ensure output
Which is the purpose data To ensure data is produced by the
39 A entered by a user correctly processed application is in All of the above
validation?
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
can start an explicit
42 A SqlConnection SqlCommand SqlParameter SqlException
transaction to update a SQL
Server database?
 When working with LINQ to
SQL, what is the main object
43 A DataContext DataSet SqlDataAdapter Entity
that moves data to and from
the database?
 Which of the following is not
44 A Java C# J# VB.NET
a .NET compatible language?
 Which of the following can
be used to terminate a while
45 A break exit statement continue exit while
loop and transfer 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
47 A ARE CRE CR REA
C#.NET code snippet given
below?
 You can assign its You must assign a
 Which statement is correct Declare using const
48 A value in the value at the time of  Both A and C
for constant? keyword constructor declaration
What is the output of the
following code snippet?
classProgram
{
publicstaticvoid Main(string[]
args)
49 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”; String s1 = “String” ; String s1 = “String”; String s1 =
String s2; String s2;
statements will correctly copy String s2; s2 = String.Concat(s1, s2 = String.Copy(s1) “String”;
the contents of one string into s2 = s1; s2) String s2;
another ? s2 =
s2.StringCopy(s
1)
The string built using the
String class are immutable
(unchangeable), whereas, the
51 B FALSE TRUE
ones built- using the
StringBuilder class are
mutable.
Which of the following will
be the correct output for the
52 B Dhaka, Bangladesh Dhaka,Bangladesh Dhaka Dhaka,
C#.NET code snippet given
below?
 You are designing an
ASP.NET Web API
application. You need to
53 select an HTTP verb to allow C PUT POST DELETE GET
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 
from  a  SQL  Server
54 D ReadUncommitted  Repeatable ReadCommitted Serializable
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?
 Which of the following is not
56 A  Integer Single String Long
value types?
What is the size of a
57 A 4byte 8byte 16byte 32byte
Decimal?
What will be the output of the
following code snippet when
it is executed?
int x = 1;
58 0.1 1 1.1 11
float y = 1.1f;
short z = 1;
Console.WriteLine((float)x +
y * z – (x += (short)y));
59 _________is the validation RegularExpressionVal RangeValidator FieldValidator  PatternValidato
control used for “Pattern
idator
matching”
 What is the property name of
60 a GridView (or a DataGrid) Vsorting EnableSorting DisableSorting AllowSorting
that regulates the sorting?
 Simple
 In SOLID Object Oriented Simple Responsibility Single Repository Single Responsibility
61 A Principle Principle Repository
Principle SRP means? Principle
Principle
There should never be one  Interface
 Single Responsibility  Liskov substitution
62 reason for a class to change” A Open-closed Principle
Principle segregation
Principle
– this statement is for – Principle
You are designing an
ASP.NET Web API
application. You need to
63 select an HTTP verb to allow C GET  DELETE  POST PUT
blog administrators to
moderate a comment. Which
HTTP verb should you use?
The throw statement needs
64 B a System.object type an exception an error A disposable type
__________ object to throw.
All integer arithmetic in a
65 ______ statement always D unchecked loop decision checked
throws an OverflowException
__________ provide a
convenient mechanism for
66 A Classes Objects Namespaces Enumerations
modeling the entities
manipulated by applications.
you write
you systematically statemnts to
you protect your
What do you do when you you group information arrange information
67 B into a meaningful
information from manipulate
design a class? for global access being altered
entity information
from database
Encapsulation is sometimes
68 A information hiding grouping abstraction polymorphism
referred to as
Which keyword is used to
69 create new instance of a A new create open object
class?
What happens if you do no Compilers generate a You class is
You cannot create You class does not
70 write any constructor for your A default constructor for objects from the class compile treated as a
class? you structure
A static class can contain
71 both static and non-static B Trues FALSE
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

Which of the following is NOT an Arithmetic operator


1 ** + –
in C#.NET?
Which of the following are NOT Relational operators
2 <>= >= <=
in C#.NET?
Which of the following is the correct output for the
3 C#.NET code snippet given below? 61 6.5 1 6.
Console.WriteLine(13 / 2 + ” ” + 13 % 2);
Which of the following are Logical operators in
4 && Xor %
C#.NET?
Which of the following is NOT an Assignment
5 \= /= *=
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 Sa
Console.Write(“Bix1 method “);
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Sample.Bix1();
}
}
}
Which of the following statements is correct about A constructor can be a static A constructor cannot be A
9
constructors in C#.NET? constructor. declared as private. ov
Which of the following will be the correct output for
the C#.NET code snippet given below?String s1 =
“ALL MEN ARE CREATED EQUAL”;
10 CRE ARE CR
String s2;
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 =
“Nagpur”;
11 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 op
user-defined types by defining static member
functions?
public abstract sample
Which of the followings is the correct way to overload public static sample operator + pu
15 operator + (sample a, sample b
+ operator? ( sample a, sample b ) (s
)
Which of the following modifier is used when a virtual
16 override overridable ov
method is redefined by a derived class?
17 Which of the following is an 8-byte Integer? Long Char Sh
18 Which of the following is NOT an Integer? Char Short Lo
19 Which of the following does not store a sign? Byte Single Lo
Which of the following is the correct size of a Decimal
20 16 Bytes 10 Bytes 4
datatype?
Which of the following is the correct ways to set a
21 value 3.14 in a variable pi such that it cannot be const float pi = 3.14F; float pi = 3.14F; co
modified?
Which of the following should be used to implement a
22 ‘Like a’ or a ‘Kind of’ relationship between two Inheritance Templates Po
entities?
Which of the following is NOT a .NET Exception
23 StackMemoryException Exception D
class?
Which of the following is the Object Oriented way of
24 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
C#.NET code snippet given below?int[ , , ] a = new int[
26 18 20 10
3, 2, 3 ];
Console.WriteLine(a.Length);
Which language is not a true object-oriented
27 VB 6 VB.NET C#
programming language?
28 Graphic Use Interaction GUI GI G
Integrated Development Integrated Design In
29 What does IDE stand for?
Environment Environment En
30 An object is composed of: All of the above. properties m
One class can create many One object can create many O
31 Which statement about objects is true?
objects. classes. ob
32 The CancelButton property belongs to which object? Form Button La
33 Which is not a common control event? SingleClick DoubleClick Cl
34 Which is a numeric data type? Integer Char St
The Date data type does not hold which type of
35 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  is an object of a class is
object
38 Private Button print = new button(); creates a button control initializes a button control bo
Represents the behavior of an Represents the attribute of an
39 An instance method Re
object 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
A variable declared inside a method is called
42 Local Static Pr
a________variable
Defining two methods with the same name but with
43 Overloading Loading M
different parameters is called.
Find any errors in the following BankAccount
44 Return type Name Fo
constructor: Public int BankAccount() { balance = 0; }
In the body of a method, C# uses the variable
45 named_____to refer to the current object whose this Call do
method is being invoked.
46 String mystring; Creates a Object Constructor Cl
Is it possible to pass methods as arguments for other
47 True FALSE
methods without modification.
What is the proper header for a class that intends to use
48 class MyClass : Iface class MyClass Iface cl
an interface.
To output the value of multidimensional array,
49 myArray[1][3] myArray[1.3] m
Console.WriteLines(___)
All methods in an abstract base class must be declared
50 False True
abstract.
Methods that are declared abstract in the base class
51 False True
must show implementation at the time of declaration.
A method_____an exception when that method detects
52 Throws Catches Tr
that a problem has occured.
A____block enclose the code that could throw an
53 Try Catch Ex
exception.
54 The proper way to convert a string to all lowercase is: string.ToLower() string.ToLower(string) To
Is it possible to change the value of a variable while
55 Yes No Bo
debugging a C# application?
Which of the following validation control is used to
56 RequiredFieldValidator CompareValidator Ra
ensure that an user does not skip a form entity field?
Which type of validation is used to check password and
57 CompareValidator CustomValidator Ra
confirm password in a login form?
Two methods with the same name but with different
58 Overloading Loading M
parameters.
Which of the following characters ends every C#
59 Semicolon (;) Period (.) Co
statement?
60 Strings are ___________ types Reference Value D
Select Case (…expression…)
61 what are the valid DataTypes in SelectCase Above all Integer ch
(expression) Statement?
The base class for all classes in .NET Framework is:
62 System.Object System.Nullable Sy
________
_________ specifies how a member is accessible
63 Encapsulation Polymorphism In
outside the class.
64 A function can return more than one value. False True
If a function returns no value, the return type must be
65 True FALSE
declared as void.
In C#, a function needs to be defined using the static
66 keyword, so that it    can be called from the Main True FALSE
function.
In a function, The return statement is not required if the
67 False True
return type is anything other than void.
A local variable declared in a function is not usable out
68 TRUE FALSE
side that function.
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 many TRUE FALSE
function, but different in their arguments.
A constructor of structure is used to initialize the
71 TRUE FALSE
variables of the structure.
72 The break command is used to exit a loop. TRUE FALSE
for(i=0;i<10;i++) fo
Console.Write(“i={0}”,i); for(i=0;i<10;i++) w
73 Which of the followings is not a nested loop?
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
10
segment? 10 9
9
x=10; 9 8
8
74 while(x>5){ 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++){
75 12 1245 3
if(x==3) break;
Console.Write(“{0}”,x);
}
76 What would be printed from the following C# code 1245 12345 12
segment?
for(x=1;x<=5;x++){
if(x==3) continue;
Console.Write(“{0}”,x);
}
Which of the following is not the component of .Net Common Language Run
77 Component Network .N
framework? time(CLR)
Following is/are the Integrated Development
78 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 All i, ii, iii and iv i, ii and iii only ii,
iii) A main method

iv) Statement & Expressions


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

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

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


Microsoft Visual C# is Microsoft’s
1 component-oriented non-procedural language declarative
powerful, _____language
_ are basic organization component of
2 Projects Solutions none
visual studio
Related projects are grouped together
3 solutions assemblies executables
into _____
Solutions cannot contain projects of
4 FALSE TRUE Both
different types and languages
    A variable is a memory A variable is a statement
A variable is a conditio
area where you can store that instructs to perform
5 What is a variable? defines alternative actio
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?
the rules to write
Which one correct definition of a a command to perform an the specification of wha
7 statements in a particular
statement? actions do
programming language
the rules to write statements
a command to perform an the specification of wha
8 Which one correct definition of syntax? in a particular programming
actions do
language
9 Which one correct definition of the specification of what the rules to write a command to perform
statements in a particular
semantics? statements do
programming language
Which of the following is are valid
10 identifiers in C#? Counter1 1stnumber $payRate

C# does not allow


Which one defines Definite Assignment C# does not allow us to use C# does not allow us to
11 declaring variable inside a
Rule in C#? an unassigned variable outside a method
method
A named sequence of
12 What is a Method? A decision statement An iteration structure
statement
Which of the following encloses method
13 {} () Begin End
body?
you want a method to return write a return statement you must add void keyw
14 you must capture it
information, you must inside the method return type
If a variable can be used at a particular
15 location in a program, the variable is scope boundary variable
said to be in ________ at that location
A variable declared inside a method is
16 local variable global variable member variable
called a
The property that contains The property that contains The property that conta
17 Which one is a read-only property?
only get block only set block and set block
A Boolean operator is an A Boolean operator always
Which one correctly defines a Boolean operator that performs a operates on Boolean values A Boolean operator is u
18
operator? calculation whose result is and produces a Boolean control a loop
either true or false value as result
Consider the following statement
19 remainder = remainder %n which one is remainder %= n remainder =% n remainder = n%
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
handling code from the code that using exceptions and using checked and
21 using error handler
implements the main flow of the exception handlers unchecked operations
program by
What is the purpose of catch handler in to catch and handle a to prevent program from
22 to report about errors to
an exception handling mechanism? specific type of exception crushing1+l
The runtime throws an
The runtime throws an
What happens if any statement inside a exception and transfers The runtime throws an
23 exception and transfers
try block generates error? control directly to the first and stops the execution
control to the finally block
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.
you systematically arrange
What do you do when you design a you group information for you protect your inform
27 information into a
class? global access being altered
meaningful entity
Encapsulation is sometimes referred to
28 information hiding grouping abstraction
as
Which keyword is used to create new
29 new create open
instance of a class?
What happens if you do no write any Compilers generate a default You cannot create objects
30 You class does not com
constructor for your class? constructor for you from the class
A static class can contain both static and
31 FALSE TRUE Both
non-static members.
Ordered sequence of Unordered sequence of
32 What is an array? Random sequence of el
elements elements
Arrays are _______, regardless of the
33 value type reference type integral type
type of their elements.
What happens If you specify an index
The compiler throws an
34 that is less than 0 or greater than or Null is returned 0 value is returned
IndexOutOfRangeException
equal to the length of the array
In System. Collections
35 Where the collection classes are live in? namespace & sub- In System. Collection In .NET Frame work
namespace
The basic collection classes accept, hold,
36 objects integers value types
and return their elements as
The ____ class implements a first-in,
37 Queue Stack Hashtable
first-out (FIFO) mechanism
The ____ class implements a last-in,
38 Stack Hashtable Queue
first-out (LIFO) mechanism
The _____ class is often called
39 Hashtable Stack ArrayList
associative array
Calling a method to achieve the effect
40 on a field feels a little clumsy. What    Properties Events Constructors
then does alleviate this awkwardness?
A property is a cross A property is a cross
A property is a bridge b
41 What is a property of a class? between a field and a between a field and the
field and its consumer
method constructor
______________looks like a field but
42 A Property A method public field
acts like a method
A __________ is a command that
43 statement variable syntax
performs an action
44 Value types are some time called _ direct type indirect type structures
45 Reference types are some time called indirect type structures enumerations
Converting a value type into reference
46 boxing casting explicit casting
type is called
Converting a reference type into value
47 unboxing casting boxing
type is called
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 the Overloading Overriding Inheritance
same name in the same scope
a method that takes a
a method that takes a fixed a method that returns on
50 What is a variadic method? variable number of
number of arguments types
arguments
The _______ inherits from the base
51 Derived class Child class New calss
class.
Which keyword is used to prevent a
52 sealed static   void
class from being inherited?
Which keyword do you use to refer a
53 base class’s member from the derived base   this parent
class?
A method that is intended to be
54 virtual method new method null method
overridden is called a
What do you call the concept “providing
55 different implementations of the base A.     Overriding casting A.     Hiding
class’s method in a derived class”?
Which class does not allow creating
56 Abstract class Sealed class    Interface class
create instances of it?
Which symbol precedes before the
57   A tilde (~) A hash(#) A pipe(|)
destructor in a class?
process of destroying an object and
58 returning memory back to the heap is Garbage collection    Memory management   Resource collection
known as
How can you release the resource by creating a disposal
59 by defining destructors by overriding ,finalize m
yourself as quickly as possible? method
The _______ statement provides a clean
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 right   Operator associativity Operator precedence Operator overloading
to left?
Which type of operator operates on just
62 Unary operator Binary operator Trinary Operator
one operand?
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 = int a =
65 Which one is implicit casting? double d; int a = 20; d = a;
(int)d Convert.ToDouble( “20
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( “20
Which property of a windows form
67 should you change to set the text shown    Text   Title   TitleText
on the title bar?
Which is the statement for running an Application.Run( Form System.Run(Form
68 Form.Run(Form instanc
application form? instance); instance);
Which property of a form can be used to
69 Opacity BackColor Transparency
control the level of transparency?
Which property of a form returns the
70 ActiveControl CurrentControl FocusedControl
control that is currently in focus?
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
72   InitializeComponent Initialize   InitializeContols
form and set their properties, wires event
handler with controls?
Which event is raised just before a
73 FormClosing Closing Disposing
windows form is actually closed?
What is the return type of the static
74 DialogResult ButtonState string
method Show the MessageBox?
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 des
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 correct
rules
Which property indicates whether a
80 CausesValidation Validation Validate
control raises validation event or not?
81 What is the default value of      true     false  0
CauseValidation?
The Validated occurs ________
82   After Before None
Validating.
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
83 ContentPlaceHolder Content PlaceHolder
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 ut
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
template with the following
86 OnDataBinding OnLoad Construct
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?
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 IEnumerable<T> IComparer<T> IEnumerator<T>
compute the median value. Which
interface should you add the extension
method to?
How to change the image of an image
88 ItemDataBound Init Prerender
control place in each row in a 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 among DataSet DataTable DataView
them?
In ADO.NET, which class can start an
93 explicit transaction to update a SQL SqlConnection SqlCommand SqlParameter
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?
Which of the following is a reference
95 string   Boolean int
type?.
Which of the following constitutes
96 CLR ASP.NET Applications Win Form Applications
the .NET Framework?
Which of the following is the root of
97 System. Object System. Type System. Base
the .NET type hierarchy?
Which of the following is not a .NET
98 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
A variable which is declared inside a
1 Local Private Static
method is called a________variable
Which of the following are not types of
2 external protect internal protect protect
access modifiers in C#?
In data reader, what can be used before
3 None Getvalue Getstring
read method?
An Event has _____ as default return
4 No return type for events String Double
type
What object can help you maintain data
5 Application Object Session object Server Object
across users?
In C#, by default structs are passed
6 By value By reference By address
how?
___________________ allow to
encapsulate discrete units of
7 functionality and provide a graphical controls object class
representation of that functionality to the
user
What does Dispose method do with
8 Deletes it from the memory Close the connection Temporary dispose the
connection object?
Which language is not a true object-
9 VB 6 VB.NET C++
oriented programming language?
Which is not a main component of the
10 Start Menu Solution Explorer Tool Box
Visual Studio IDE?
Which are the standard prefixes for the
11 Button and Combo box controls btn and cbo btn and chb bto and chb
respectively?
One class can create many One object is used to create One class is used to cre
12 Which statement about objects is true?
objects one class. object
Which property determines whether a
13 Visible Hide Show
control is displayed to the user?
Related projects are grouped together
14 solutions assemblies executables
into ______________
Consider the statement N= 5; What type An assignment statement; it
15 variable declaration A selection statement
of statement is it? assign value 5 to variable N
A named sequence of
16 What is a Method? A decision statement An iteration structure
statement
The ____________ of a method
describes the types and names of the
17 parameter list return type method name
information that you can pass into the
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
How many times the loop will repeat? This loop will never
19 0 1
for(inti=1; ;i++) { //code } terminate
Whatis the purposeof catch handler in an to catch and handle a to prevent program from
20 to report about errors to
exception handlingmechanism? specifictype of exception crushing1+l
What happens if a try block throws an The runtime executes its The runtime exits the tr
The program terminates
21 exception and there is no corresponding own error routine and tries to execute stateme
with an unhandled exception
catch handler? executes next statement immediately after the tr
Encapsulation is sometimes referred to
22 information hiding polymorphism abstraction
as ________________
Reference types are some time called
23 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
decimal.TryParse(value, int.TryParse(value,
application. You need to parse a text decimal.TryParse(value
25 NumberStyles.Currency, NumberStyles.Currency,
field where the user enters an amount of ServerCulture);
UICulture); UICulture);
money. Which method do you use?
You need to validate an XML file. What
26 XSD JavaScriptSerializer RegEx
do you use?
Bob and Alice are using an asymmetric
Bob sends Alice his public Bob sends Alice his private
algorithm to exchange data. Which key Bob sends Alice his pri
27 key, and Alice sends Bob key, and Alice sends Bob
should they send to the other party to and Alice sends Bob he
her public key. her public key.
make this possible?
You are creating a new collection type
and you want to make sure the elements
28 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
doesn’t require any particular order and
29 AsParallel AsSequential AsOrdered
you want to run it in parallel. Which
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 You should consider br
bringing the customErrors
30 accordance with the prerequisites. attribute in the customErrors attribute i
attribute in the web.config
Which of the following actions should machine.config file up to app.config file up to da
file up to date.
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 to
The RegisterGlobalFilters The RegisterLocalFilters
31 write code that creates a method that The JoinGlobalFilters m
method. method.
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 met. process mode.
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 allows for users from various
countries to access the application based
You should consider making You should consider
on their respective cultures. As a result, You should consider m
33 use of the ViewBag making use of the
the application includes various resource the Html property.
property. ViewContext property.
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?
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
34 QueryString Session Application
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?
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.
server.
application. You detect performance bundling.
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
multiple browsers. You must track the
41 QueryString Session Application
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?
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 2012. using ASP.NET MVC in the ASP.NET MVC
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” ty
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
schema definition language (SSDL), and EDM Generator
55 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 administrators POST GET DELETE
to moderate a comment. Which HTTP
verb should you use?
57 You are planning to migrate websites Web Deploy RoboCopy Microsoft command-lin
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
60 each client session. You need to choose PerSession PerCall Single
an instancing mode. Which instance
mode should you use?
You are developing a WCF service. A
new service instance must be created for
61 each client request. You need to choose PerCall Single PerRequest
an instancing mode. Which instancing
mode should you use?
You are designing an ASP.NET Web
API application. You need to select an
62 HTTP verb to allow blog administrators DELETE PUT POST
to remove a comment. Which HTTP
verb should you use?
You are developing an ASP.NET MVC
application that reads and writes data
63 from a SQL Server database. You need Serializable ReadUncommitted Repeatable
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.
65 You have been informed that blog PUT GET SET
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
application using ASP.NET MVC Web
66 API. You have been informed that the The GET method. The SET method. The PUT method.
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
Use the CacheDependency
HttpContext.Cache object. You need to EffectivePrivateBytesLimit Change the sliding expi
68 type configured to monitor
ensure that the cache is correctly value is greater than the cache item to 12 hours.
the SFTP target folder.
updated when new data arrives. What size of the database file.
should you do?
You need to load flight information SQL Server Data
OleDbConnection and EntityTransaction and
69 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
OleDbDataReader
What should you use?
You need to make the “Distance” header
of the table bold in the table > tr > th:nth-child(2) table > tr { font-weight: table > th:last-child { fo
71
Views/RunLog/GetLog.cshtml view. { font-weight: bold; } bold; } bold; }
Which code segment should you use?
You need to make all of the rows in the
table bold in the table > tr { font-weight: table > th:last-child { font- table + first-child { font
72
Views/RunLog/GetLog.cshtml view. bold; } weight: bold; } bold; }
Which code segment should you use?
You need to implement client-side
animations according to the business
requirements. Which line of code should $(“body h1:nth- $(“body h1:nth- $(“body h1:nth-
73
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
make use of a ustom role provider, You should consider m
75 changes to the web.config making changes to the
named CyclingLogRoleProvider. Which changes to the app.conf
file. machine.config file.
of the following actions should you
take?
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 ADO.NET Entity Data
76 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 administrators POST GET DELETE
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
access to SSH or a VPN. You need to
78 Web Deploy RoboCopy Microsoft command-lin
select a deployment tool to securely
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 application In the Package/Publish
Create a web publish Extend the
to production. The deployment package settings of the project,
80 pipeline target file with a CopyAllFilesToSingleF
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
82 each client session. You need to choose PerSession PerCall Multiple
an instancing mode. Which instance
mode should you use?
You are developing a WCF service. A
new service instance must be created for
83 each client request. You need to choose PerCall Single PerRequest
an instancing mode. Which instancing
mode should you use?
You are designing an ASP.NET Web
API application. You need to select an
84 HTTP verb to allow blog administrators DELETE PUT POST
to remove a comment. Which HTTP
verb should you use?
You are developing an ASP.NET MVC
application that reads and writes data
85 from a SQL Server database. You need Serializable ReadUncommitted Repeatable
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.
87 You have been informed that blog PUT GET SET
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
application using ASP.NET MVC Web
88 API. You have been informed that the The GET method. The SET method. The PUT method.
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 ABC.com.
You are in the process of creating
ASP.NET MVC Web API application.
You should consider making You should consider
You are required to write code that You should consider m
89 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 expi
Messenger is cached in the
HttpContext.Cache object. You need to EffectivePrivateBytesLimit
type configured to monitor
ensure that the cache is correctly value is greater than the cache item to 12 hours.
the SFTP target folder.
updated when new data arrives. What size of the database file.
should you do?
You need to load flight information SQL Server Data
OleDbConnection and EntityTransaction and
92 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
OleDbDataReader
What should you use?
Arrange following datatype in order of
94 increasing magnitude sbyte, short, long, sbyte < short < int < long long < short < int < sbyte short < sbyte < int < lon
int.
’a’ is a reference to an
Which statement is correct about
object of a class that ’a’ is reference to the array ’a’ is a reference to an o
95 following c#.NET code? int[] a= {11, 3,
compiler drives from created on stack created on stack
5, 9, 6};
‘System.Array’ class
In C#, by default structs are passed
96 By value. By reference. By address.
how?
What does Dispose method do with
97 Deletes it from the memory Close the connection Temporary dispose the
connection object?
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 on
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
assembly. You need to merge the provided by Trey Research, to merge the Trey Research
100 sign the application’s p
assemblies provided by Trey Research and then stipulate the output assemblies without
output assembly with th
and meet the application specification. must be signed with the stipulating a key pair.
key pair.
What should you do? Trey.snk key pair.
SL Question Correct Answer Wrong Ans-1 Wrong Ans-2
How much Bytes are stored by ‘Long’
1 8 4 2
Datatype in C# .net?
Correct way to assign values to variable
2 c = a + convert.ToInt32(b); c = a + b; c = a + int(float(b));
‘c’ when int a=12, float b=3.5,int c;
Select a convenient deceleration and float somevariable = (float) float somevariable = float somevariable = (D
3
initializing of a floating point number: 12.502D 12.502D 12.502D
Number of digits upto which precision
4 Upto 7 digit Upto 6 digit Upto 8 digit
value of float datatype is valid ?
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
Why string made reference type in To overcome problem o
7 To reduce size of string To create string on stack
C#.NET ? stackoverflow
Syntax for declaration and initialization <data type><var_name> =
8 <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 to converting a reference type
 In ‘Boxing’ we need ex
Choose effective differences between the reference type and to value type and
9 conversion and in ‘Unb
‘Boxing’ and ‘Unboxing’. ‘Unboxing’ is the process of ‘Unboxing’ is the process
need implicit conversio
converting reference to of converting value type to
value type reference type
Implicit Conversion and
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 ?
The correct way of incrementing the
13 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) while(condition);
17 Correct syntax for while statement is: while(condition){}
{}; {}
What is most specified using class
18 type & scope Type scope
declaration ?
Correct way of declaration of object of
19 following class is ? name n = new name(); n = name(); name n = name();
class name
The data members of a class by default
20 private protected,public private,public
are ?
Which refrence modifier is used to
21 Ref & #
define reference variable?
What is output for following set of
22 Int Float long
expression? int a+= (float) b/= (long)c.
public int cube(int x)
Which return statement correctly returns { public int cube(int x) public int cube(int x)
23
the output: return (x + x); return (x + x); return (x + x);
}
Number of constructors a class can
24 Any number 1 2
define of ?
Which method have same name as that
25 constructor Delete class
of its class?
Operator used to free the memory when
26 delete New free
memory is allocated ?
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?
Choose the base class for string()
29 System.String System.Array System.char
method :
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
32 to be removed from the end of strings Trim() Remove() TrimEnd()
are removed from string by mentioning
number of characters to be removed?
Which of these method of class String is
33 used to seperate a substring from a Substring() substring() SubString()
String object?
Which of these method of class String is
34 length() get() Sizeof()
used to obtain length of String object?
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?
Keyword used to define call by
39 Ref & out
reference paramter in C# .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 + public abstract operator
42 Correct way to overload +operator? All of above
( sample a, sample b) a,sample b)
When no reference refers
When does structure variable get As variable goes out of the Depends on either it is c
43 to it,it will get garbage
destroyed? scope using new or without ne
collected
An enum variable cannot An enum variable cannot
Choose correct statements about enum An enum variable can b
44 have a protected access have a private access
used in C#.NET? 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?
Which is correct way to create an object Declaring existing class as Declaring existing class as Declaring existing class
47
of given class abc? sealed override overloads
Which form of inheritance is not
48 Multiple inheritance Multilevel inheritance Single inheritance
supported directly by C# .NET?
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?
Which of given modifiers can be used to
51 Sealed Static Constant
prevent Method overriding?
When we call a constructor method
among different given constructors. We
match the suitable constructor by
matching the name of constructor first
52 Polymorphism Method overriding Inheritance
then the number and type of parameters
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?
Which of these operator must be used to
54 : & ::
inherit a class?
A type of class which does not have it’s
55 own objects but acts as a base class for Abstract class Static class Sealed class
it’s subclass is known as?
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 operator
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()
Which of these will happen if recursive infinite loop condition After 10000 executions
59 System gets hangup
method does not have a base case? occurence will be automatically st
Which of these data types is used by
60 operating system to manage the Stack Array Queue
Recursion in Csharp?
Choose the keyword which declares the
61 This Base super
indexer?
Which statement correctly defines about Interfaces cannot be Interfaces consists of da
62 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?
Does C#.NET supports partial
64 FALSE TRUE Can’t Say
implementation of interfaces?
Which of these can be used to fully
65 Interfaces Objects Packages
abstract a class from its implementation?
When no exception is caught thrown at
66 CLR Operating System Loader
runtime then who will catch it?
Which of these clause will be executed
67 finally Throws throw
even if no exceptions are found?
Which of these exceptions handles the
68 ArithmeticException MathException IllegalAccessException
divide by zero error?
Which of these class is related to all the
69 Throwable Throw Exception
exceptions that are explicitly 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
Which of the keywords used for the
71 Try Catch throw
block to be examined for exceptions?
Once applied and hence further which of
72 the following cannot inspect the applied Linker ASP.NET Runtime Language compilers
attribute?
Which among the following cannot be a
73 Namespace Enum Event
target for a custom attribute?
The [Serializable()] attributes gets
74 run time compile time design time
inspected at:
Which of the class provides the
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?
Choose the output return when read()
78 Integer String Char
reads the character from the console?
Which method in Console enables to
79 read individual inputs directly from the ReadKey() Read() ReadLine()
keyboard in a non line buffered manner?
What is output returned by Console if
80 /O EXCEPTION ERROR 1 0
ReadLine() stores I/O error?
Which of these classes are used by Byte
81 InputOutputStream InputStream Reader
streams for input and output operation?
Which of these class is used to create an
82 object whose character sequence is StringBuilder() String() Both of the mentioned
mutable?
Select the method used to write single
83 WriteByte() Write() Wrteline()
byte to a file?
Select the namespace on which the
84 System.IO System.Input System.Output
stream classes are defined?
Choose the class on which all stream
85 System.IO.stream Sytem.Input.stream System.Output.stream
classes are defined?
Choose the stream class method which
86 void close() close() static close()
is used to close the connection:
Which of these data type is returned by
87 None of the mentioned int float
every method of OutputStream?
Name the property among the following
88 which represents the current position of long Length long Position int Length
the stream.
From Which of these classes the
89 character based output stream class TextWriter TextReader Character Stream
Stream Writer is derived?
Which of these keywords are used to
90 synchronized Synchronize syn
implement synchronization?
Which keyword is used for using the
91 synchronization features defined by the Lock Synchronized Monitor
Monitor class?
Which method is used to abort thread
92 Abort() sleep() terminate()
prior to it’s normal execution?
By multithreading CPU’s
A thread can exist only in By multitasking CPU’s
idle time is minimized, and
93 Which of these statements is incorrect? two states, running and minimized, and we can
we can take maximum use
blocked maximum use of it
of it
Which exception is being thrown if the
94 UriFormatException URLNotFound URLSourceNotFound
URI format is invalid?
Which of these class is used for
95 operating on request from the client to httpd http httpDecoder
the server?
Which among these access specifiers
96 public Private protected
should be used for main() method?
Which among the given class provides
97 Math Process System
types of rounding functions?
Which of these method is a rounding
98 Round() Max() Min()
function of Math class?
Which of these class contains only
99 Math Process System
floating point functions?
Which of these type parameters is used
100 for a generic methods to return and T K N
accept any type of object?
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