|
|
|
1. How do you convert a string into an integer in .NET? Int32.Parse( string)
2. How do you box a primitive data type variable? Assign it to the object, pass an object.
3. Why do you need to box a primitive variable?
To pass it by reference.
4. What’s the difference between Java and .NET garbage collectors?
Sun left the implementation of a specific garbage collector up to the JRE developer, so their performance varies widely, depending on whose JRE you’re using. Microsoft standardized on their garbage collection.
5. How do you enforce garbage collection in .NET? System.GC.Collect ( );
6. Can you declare a C++ type destructor in C# like ~MyClass ()?
Yes, but what’s the point, since it will call Finalize(), and Finalize() has no guarantees when the memory will be cleaned up, plus, it introduces additional load on the garbage collector.
7. What’s different about namespace declaration when comparing that to package declaration in Java?
No semicolon.
8. What’s the difference between const and read only?
You can initialize read only variables to some runtime values. Let’s say your program uses current date and time as one of the values that won’t change. This way you declare public read only string DateT = new DateTime ().ToString ().
9. What does \a character do?
On most systems, produces a rather annoying beep.
10. Can you create enumerated data types in C#?
Yes.
11. What’s different about switch statements in C#?
No fall-throughs allowed.
12. What happens when you encounter a continue statement inside the for loop?
The code for the rest of the loop is ignored; the control is transferred back to the beginning of the loop.
13. Is goto statement supported in C#? How about Java?
Gotos are supported in C# to the fullest. In Java goto is a reserved keyword that provides absolutely no functionality.
|
| Author: pritesh 17 Oct 2007 | Member Level: Bronze Points : 1 |
it's fantastic thank u i collect this Q in my collectio
|