What namespaces are necessary to create a localized application?
System.Globalization and System.Resources.
What is the smallest unit of execution in .NET?
an Assembly.
When should you call the garbage collector in .NET?
As a good rule, you should not call the garbage collector. However, you could call the garbage collector when you are done using a large object (or set of objects) to force the garbage collector to dispose of those very large objects from memory. However, this is usually not a good practice.
How do you convert a value-type to a reference-type?
Use Boxing.
What happens in memory when you Box and Unbox a value-type?
Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.Difference between directcast and ctype.
Answer1
DirectCast requires the run-time type of an object variable to bethe same as the specified type.The run-time performance ofDirectCast is better than that of CType, if the specified type and the run-time typeof the expression are the same. Ctype works fine if there is a valid conversion defined between the expression and the type.
Answer2
The difference between the two keywords is that CType succeeds as long as there is a valid conversion defined between the expression and the type, whereas DirectCast requires the run-time type of an object variable to be the same as the specified type. If the specified type and the run-time type of the expression are the same, however, the run-time performance of DirectCast is better than that of CType.
An example of a ctype and directcast.
In the preceding example, the run-time type of Q is Double. CType succeeds because Double can be converted to Integer, but DirectCast fails because the run-time type of Q is not already Integer
ctype(123.34,integer) - should it throw an error? Why or why not?
Answer1
It would work fine. As the runtime type of 123.34 would be double, and Double can be converted to Integer.
Answer2
the ctype(123.34,integer) will work fine no errors
directcast(123.34,integer) - should it throw an error? Why or why not?
It would throw an InvalidCast exception as the runtime type of 123.34 (double) doesnt match with Integer.
Difference between a sub and a function.
Answer1
A Sub does not return anything whereas a Function returns something.
Answer2
-A Sub Procedure is a method will not return a value
-A sub procedure will be defined with a “Sub” keyword
Sub ShowName(ByVal myName As String)
Console.WriteLine(”My name is: ” & myName)
End Sub
-A function is a method that will return value(s).
-A function will be defined with a “Function” keyword
Function FindSum(ByVal num1 As Integer, ByVal num2 As Integer) As Integer
Dim sum As Integer = num1 + num2
Return sum
End Function
Explain manifest & metadata.
Answer1
Manifest is metadata about assemblies. Metadata is machine-readable information about a resource, or “”data about data.” In .NET, metadata includes type definitions, version information, external assembly references, and other standardized information.
Answer2
Manifest: Manifest describes assembly itself. Assembly Name, version number, culture, strong name, list of all files, Type references, and referenced assemblies.
Metadata: Metadata describes contents in an assembly classes, interfaces, enums, structs, etc., and their containing namespaces, the name of each type, its visibility/scope, its base class, the nterfaces it implemented, its methods and their scope, and each method’s parameters, type’s properties, and so on.
Difference between imperative and interrogative code.
There are imperative and interrogative functions. Imperative functions are the one which return a value while the interrogative functions do not return a value.
Wednesday, July 16, 2008
Subscribe to:
Post Comments (Atom)
Archives
-
▼
2008
(201)
-
▼
July
(64)
- Acronyms in .NET
- Short Answer .NET Interview Questions (PAGE 5)
- Short Answer .NET Interview Questions (PAGE 4)
- Short Answer .NET Interview Questions (PAGE 3)
- Short Answer .NET Interview Questions (PAGE 2)
- Short Answer .NET Interview Questions (PAGE 1)
- VB.NET Interview Questions 16
- VB.NET Interview Questions 15
- VB.NET Interview Questions 14
- VB.NET Interview Questions 13
- VB.NET Interview Questions 12
- VB.NET Interview Questions 11
- VB.NET Interview Questions
- VB.NET Interview Questions 9
- VB.NET Interview Questions 8
- VB.NET Interview Questions 6
- VB.NET Interview Questions 5
- VB.NET Interview Questions 4
- VB.NET Interview Questions 3
- VB.NET Interview Questions 2
- VB.NET Interview Questions 1
- ASP.NET 2.0Interview Questions see
- Tough ASP.NET interview questions all see
- ASP.NET INTERVIEW QUESTIONS 16
- dot see it
- dot net free interview questions see
- General C# Interview Questions :
- C# Interview Questions and Answers 15
- C# Interview Questions and Answers 14
- C# Interview Questions and Answers 13
- C# Interview Questions and Answers 12
- C# Interview Questions and Answers 11
- C# Interview Questions and Answers 10
- C# Interview Questions and Answers 9
- C# Interview Questions and Answers8
- C# Interview Questions and Answers7
- C# Interview Questions and Answers 6
- C# Interview Questions and Answers 5
- C# Interview Questions and Answers 4
- C Interview Questions 3
- C Interview Questions 2
- C Interview Questions
- .Net Web Interview Questions and Answers 5
- .Net Web Interview Questions and Answers 4
- .Net Web Interview Questions and Answers 3
- Which of the following operators has the highest p...
- .Net Web Interview Questions and Answers
- dotnet
- .Net Database Interview Questions 12
- Microsoft .Net Interview Questions 00
- .Net Database Interview Questions and Answers free
- What are different methods of session maintenance ...
- Microsoft .Net Interview Questions and Answers 8
- Microsoft .Net Interview Questions and Answers 2
- Microsoft .Net Interview Questions and Answers
- .Net Interview Questions and Answers 10
- .Net Interview Questions and Answers 8
- .Net Interview Questions and Answers 6
- .Net Interview Questions and Answers 5
- .Net Interview Questions and Answers 4
- .Net Interview Questions and Answers 3
- dot net interview questions 2
- .Net Interview Questions and Answers 1
- Interview questions for .NET
-
▼
July
(64)
No comments:
Post a Comment