1) What is the .NET collection class that allows an element to be accessed using a unique key?
A) SortedListClass
B) HashTableClass
C) CollectionBase
D) Stack
E) Queue
Ans: (B)
2) What is true about read only variables?
A) Can be allocated at compile time.
B) Can be allocated at run time
C) Declaration and initialization can be separated
D) All of the above
Ans: (D)
-------------------------------
Explanation:
'const':
Can't be static.
Value is evaluated at compile time.
Initiailized at declaration only.
'readonly':
Can be either instance-level or static.
Value is evaluated at run time.
Can be initialized in declaration or by code in the constructor.
--------------------------------
3) Defining two methods with the same name but with different parameters is called:
A) Loading
B) Overloading
C) Encapsulation
D) Inheritance
Ans: (B)
4) Difference between Convert and parse methods?
A) Convert converts the values, parse is for parsing
B) Both are same
C) Convert allows null values, parse cannot
D) None of the above
Ans: (C)
---------------------------------
Explanation:
The two give identical results, except where the string is null. Convert.ToInt32(null) returns zero, whereas Int32.Parse(null) throws an ArgumentNullException.
int i = Convert.ToInt32("23");
i = 23
int i1 = Convert.ToInt32("abc");
format exception
int i2 = Convert.ToInt32("");
format exception
int i3 = Convert.ToInt32(null);
i = 0
ConverTo also handled ENUM values.
---------------------------------
5) Default return type of an event is:
A) String
B) Integer
C) Event don't have any return type
D) None of the above
Ans: (C)
6) Convert.ToString() and ToString() has main difference:
A) ToString() handle null values but Convert.ToString() don't
B) Convert.ToString() handle null values but ToString() don't
C) ToString() output as per form at supplied
D) Convert.ToString() only handle null values
Ans: (B)
------------------------------------------
Explaination:
Convert take care of null values also.
string str = Convert.ToString(null);
str = null
------------------------------------------
7) How does assembly versioning in .NET prevents DLL Hell?
A) The runtime checks to see that only one version of an assembly is on the machine at any one time.
B) .NET allows assembly to specify the name and the version of any assembly they need to run.
C) The compiler offers compile time checking for backward compatibility
D) It doesn't
Ans: (B)
8) What is delegate?
A) Light weight thread or process that can call a single method
B) A reference to an object in a different process.
C) An inter-process message channel
D) A strongly typed function pointer.
Ans: (D)
9) What is satellite assembly?
A) A peripheral assembly designed to monitor permission requests from an application
B) Any DLL file used by an EXE file
C) An assembly designed to alter the appearance or 'skin' of an application
D) An assembly containing localized resources for another assembly.
Ans: (D)
10) What is boxing in .NET?
A) Encapsulating an object in a value type
B) Encapsulating a copy of an object in a value type
C) Encapsulating a value type in an object
D) Encapsulating a copy of a value type in an object
Ans: (D)
11) The C# keyword int maps to which .NET type?
A) System.int16
B) System.int32
C) System.int64
D) System.int128
E) System.int256
Ans: (B)
12) What is the difference between Server.Transfer and Response.Redirect?
A) Response.Redirect is used to post a form to another page, Server.TRansfer is used to redirect the user to another page or site.
B) Server.TRansfer is used to post a form to another page, Response.Redirect is used to redirect the user to another page or site.
C) Server.TRansfer is used to get a form from another page, Response.Redirect is used to redirect the user to same page or site.
D) Answer B and C
Ans: (B)
--------------------------------------------
Explanation:
Response.Redirect sends HTTP code 302 down to the users browser along with the new URL location of the wanted page.
HTTP Code 302 actually means ' The requested resource resides temporarily under a different URI'.
After browser receives this code it tries to open the new location of the resource that was suggested by the server.
This actually causes two requests to the server, first one to the original URL, and second to the new URL that is suggested via 302 response.
All the Query Strings and Form variables are lost during the redirect and they are not available to the redirected URL.
In contrast to all this when we call Server.Transfer we do not initiate another request to the server, but the original request is simply rewritten and transfered to some other page on the same server.
Response.Redirect should be used when:
-we want to redirect the request to some plain HTML pages on our server or to some other web server
-we don't care about causing additional roundtrips to the server on each request
-we do not need to preserve Query String and Form Variables from the original request
-we want our users to be able to see the new redirected URL where he is redirected in his browser (and be able to bookmark it if its necessary)
Server.Transfer should be used when:
-we want to transfer current page request to another .aspx page on the same server
-we want to preserve server resources and avoid the unnecessary roundtrips to the server
-we want to preserve Query String and Form Variables (optionally)
-we don't need to show the real URL where we redirected the request in the users Web Browser
--------------------------------------------
13) What data type does the RangeValidator control support?
A) Interger,String,Date
B) Integer and string only
C) only String
D) Only Integer
Ans: (A)
14) In the Url listed below what does the string (nav45m672ren60vizat) represent?
http://server.com/(nav45m672ren60vizat)/page.aspx
A) CookieID
B) connectionStringID
C) DataBaseID
D) ApplicationID
E) SessionID
Ans: (E)
15) Which one of the following object oriented techniques allows you to make changes in your code without impacting calling classes:
A) Interface
B) Inheritance
C) Polymorphism
D) Abstraction
E) Encapsulation
Ans: (A)
16) Can we overwrite one web.config file with another web.config file in an ASP.NET application?
A) Yes
B) No
Ans: (A) yes
17) What is the name of the web page property that you can query to determine that a web page is being requested without data being submitted?
A) FirstGet
B) Initialized
C) IncludesData
D) IsPostBack
Ans: (D)
18) What method must be overridden in a custom control?
A) The build() method
B) The controlBuild() method
C) The render Method
D) The default constructor
Ans: (C)
19) How do you explicitly kill a user session?
A) Session.Close()
B) Session.Discard()
C) Session.Abandon()
D) Session.End()
Ans: (C)
20) How many web.config files can be there in an ASP.NET application?
A) only 1
B) Only 2
C) More than one
D) Upto 10
Ans: (C)
A) SortedListClass
B) HashTableClass
C) CollectionBase
D) Stack
E) Queue
Ans: (B)
2) What is true about read only variables?
A) Can be allocated at compile time.
B) Can be allocated at run time
C) Declaration and initialization can be separated
D) All of the above
Ans: (D)
-------------------------------
Explanation:
'const':
Can't be static.
Value is evaluated at compile time.
Initiailized at declaration only.
'readonly':
Can be either instance-level or static.
Value is evaluated at run time.
Can be initialized in declaration or by code in the constructor.
--------------------------------
3) Defining two methods with the same name but with different parameters is called:
A) Loading
B) Overloading
C) Encapsulation
D) Inheritance
Ans: (B)
4) Difference between Convert and parse methods?
A) Convert converts the values, parse is for parsing
B) Both are same
C) Convert allows null values, parse cannot
D) None of the above
Ans: (C)
---------------------------------
Explanation:
The two give identical results, except where the string is null. Convert.ToInt32(null) returns zero, whereas Int32.Parse(null) throws an ArgumentNullException.
int i = Convert.ToInt32("23");
i = 23
int i1 = Convert.ToInt32("abc");
format exception
int i2 = Convert.ToInt32("");
format exception
int i3 = Convert.ToInt32(null);
i = 0
ConverTo also handled ENUM values.
---------------------------------
5) Default return type of an event is:
A) String
B) Integer
C) Event don't have any return type
D) None of the above
Ans: (C)
6) Convert.ToString() and ToString() has main difference:
A) ToString() handle null values but Convert.ToString() don't
B) Convert.ToString() handle null values but ToString() don't
C) ToString() output as per form at supplied
D) Convert.ToString() only handle null values
Ans: (B)
------------------------------------------
Explaination:
Convert take care of null values also.
string str = Convert.ToString(null);
str = null
------------------------------------------
7) How does assembly versioning in .NET prevents DLL Hell?
A) The runtime checks to see that only one version of an assembly is on the machine at any one time.
B) .NET allows assembly to specify the name and the version of any assembly they need to run.
C) The compiler offers compile time checking for backward compatibility
D) It doesn't
Ans: (B)
8) What is delegate?
A) Light weight thread or process that can call a single method
B) A reference to an object in a different process.
C) An inter-process message channel
D) A strongly typed function pointer.
Ans: (D)
9) What is satellite assembly?
A) A peripheral assembly designed to monitor permission requests from an application
B) Any DLL file used by an EXE file
C) An assembly designed to alter the appearance or 'skin' of an application
D) An assembly containing localized resources for another assembly.
Ans: (D)
10) What is boxing in .NET?
A) Encapsulating an object in a value type
B) Encapsulating a copy of an object in a value type
C) Encapsulating a value type in an object
D) Encapsulating a copy of a value type in an object
Ans: (D)
11) The C# keyword int maps to which .NET type?
A) System.int16
B) System.int32
C) System.int64
D) System.int128
E) System.int256
Ans: (B)
12) What is the difference between Server.Transfer and Response.Redirect?
A) Response.Redirect is used to post a form to another page, Server.TRansfer is used to redirect the user to another page or site.
B) Server.TRansfer is used to post a form to another page, Response.Redirect is used to redirect the user to another page or site.
C) Server.TRansfer is used to get a form from another page, Response.Redirect is used to redirect the user to same page or site.
D) Answer B and C
Ans: (B)
--------------------------------------------
Explanation:
Response.Redirect sends HTTP code 302 down to the users browser along with the new URL location of the wanted page.
HTTP Code 302 actually means ' The requested resource resides temporarily under a different URI'.
After browser receives this code it tries to open the new location of the resource that was suggested by the server.
This actually causes two requests to the server, first one to the original URL, and second to the new URL that is suggested via 302 response.
All the Query Strings and Form variables are lost during the redirect and they are not available to the redirected URL.
In contrast to all this when we call Server.Transfer we do not initiate another request to the server, but the original request is simply rewritten and transfered to some other page on the same server.
Response.Redirect should be used when:
-we want to redirect the request to some plain HTML pages on our server or to some other web server
-we don't care about causing additional roundtrips to the server on each request
-we do not need to preserve Query String and Form Variables from the original request
-we want our users to be able to see the new redirected URL where he is redirected in his browser (and be able to bookmark it if its necessary)
Server.Transfer should be used when:
-we want to transfer current page request to another .aspx page on the same server
-we want to preserve server resources and avoid the unnecessary roundtrips to the server
-we want to preserve Query String and Form Variables (optionally)
-we don't need to show the real URL where we redirected the request in the users Web Browser
--------------------------------------------
13) What data type does the RangeValidator control support?
A) Interger,String,Date
B) Integer and string only
C) only String
D) Only Integer
Ans: (A)
14) In the Url listed below what does the string (nav45m672ren60vizat) represent?
http://server.com/(nav45m672ren60vizat)/page.aspx
A) CookieID
B) connectionStringID
C) DataBaseID
D) ApplicationID
E) SessionID
Ans: (E)
15) Which one of the following object oriented techniques allows you to make changes in your code without impacting calling classes:
A) Interface
B) Inheritance
C) Polymorphism
D) Abstraction
E) Encapsulation
Ans: (A)
16) Can we overwrite one web.config file with another web.config file in an ASP.NET application?
A) Yes
B) No
Ans: (A) yes
17) What is the name of the web page property that you can query to determine that a web page is being requested without data being submitted?
A) FirstGet
B) Initialized
C) IncludesData
D) IsPostBack
Ans: (D)
18) What method must be overridden in a custom control?
A) The build() method
B) The controlBuild() method
C) The render Method
D) The default constructor
Ans: (C)
19) How do you explicitly kill a user session?
A) Session.Close()
B) Session.Discard()
C) Session.Abandon()
D) Session.End()
Ans: (C)
20) How many web.config files can be there in an ASP.NET application?
A) only 1
B) Only 2
C) More than one
D) Upto 10
Ans: (C)
No comments:
Post a Comment