C# Test Paper's Answers

1,448 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,448
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

C# Test Paper's Answers

  1. 1. C# and ASP.NET Test Paper AnswersA1.(c) ClassesA2. (a) System.ObjectA3. (d) A delegate object encapsulates a reference to a methodA4. (c) Start()A5. Both String and StringBuilder are classes used to handle strings. The most common operation with a string is concatenation. This activity has to be performed very efficiently. When we use the "String" object to concatenate two strings, the first string is combined to the other string by creating a new copy in the memory as a string object, and then the old string is deleted. This process is a little long. Hence we say "Strings are immutable". When we make use of the "StringBuilder" object, the Append method is used. This means, an insertion is done on the existing string. Operation on StringBuilder object is faster than String operations, as the copy is done to the same location. Usage of StringBuilder is more efficient in case large amounts of string manipulations have to be performed.A6. The Common Language Runtime (CLR) is the run time environment that provides the underlying infrastructure for the .NET Framework. It is where the source code of an application is compiled into an intermediate language. CLR translates the IL into the native code of the operating system using a just-in-time (JIT) compiler. Not only does the CLR execute code, but it also provides a whole set of related services such as code verification, optimization, and object management.A7. System.Web.UI.PageA8. The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to application-level events raised by ASP.NET.A9. <appSettings>, <system.web> and <connectionStrings>A10. // Create the cookie object. HttpCookie cookie = new HttpCookie("Preferences"); // Set a value in it. cookie["LanguagePref"] = "English"; // Add another value. cookie["Country"] = "US"; // Add it to the current web response. Response.Cookies.Add(cookie);

×