-
-
-
Whitespace in XML Parser
When whitespace is encountered by an XML parser within the element content, how is it handled by the XML parser?
-
ByteArray Class
Write a class called ByteArray that implement allocating, reading and writing to an array of bytes. The runtime environment has a limitation. The maximum continuous memory size that it can allocated is 64k bytes. It can allocate many 64K ( or less) chunks. The ByteArray class should hide this limitation and support allocating arrays larger than 64K as in the following example :ByteArray ba = new ByteArray...
-
How do I convert a string to an int in C#?
Here's an example: using System;class StringToInt{public static void Main(){String s = "105";int x = Convert.ToInt32(s);Console.WriteLine(x);}}
-
How do destructors and garbage collection work in C#?
C# has finalizers (similar to destructors except that the runtime doesn't guarantee they'll be called), and they are specified as follows: class C{~C(){// your code}public static void Main() {}}Currently, they override object.Finalize(), which is called during the GC process.
-
Why do I get a syntax error when trying to declare a variable called checked?
The word checked is a keyword in C#.
-
Does Console.WriteLine() stop printing when it reaches a NULL character within a string?
Strings are not null terminated in the runtime, so embedded nulls are allowed. Console.WriteLine() and all similar methods continue until the end of the string.
-
Garbage Collector:
Skill/Topic: AdvancedA) Copies the IL code to the heapB) Destroys the pointersC) is responsible for automatic memory management
-
Method Overloading and Overriding are the same
Skill/Topic: IntermediateA) TrueB) FalseExplanation: Overloading is changing the behavior of a method in a derived class, whereas overriding is having multiple methods with the same name
-
What is similar in concept to IL?
Skill/Topic: IntermediateA) Java Byte CodeB) C++ LibrariesC) Machine Language
-
Is there an equivalent to the instanceof operator in Visual J++?
C# has the is operator: expr is type
-
If you need your own implementation of Equals method of object what needs to be done
A) Overload Equals methodB) Override Equals methodC) Implements Equals method
-
Which statement is invalid with regards to Constant
A) They must be initialized when they are declaredB) The value of the constant must be computable at compile timeC) Constants are not staticD) Constant is a variable whose value can be changed through out it’s life time when it is static.
-
Which of the member is not a member of Object
A) Equals ( )B) GetType ( )C) ToString ( )D) Parse( )
-
Which of the following is not a C# reserved keyword
A) IsB) AsC) InD) Of
-
Which of the following can not be declared as virtual
A) Static functionsB) Member fieldsC) Instance functions
-
Sealed class can be inherited
A) TrueB) FalseExplanation: Sealed class cannot be inherited
-
What is the difference between a struct and a class in C#?
From language spec:The list of similarities between classes and structs is as follows. Longstructs can implement interfaces and can have the same kinds of members as classes. Structs differ from classes in several important ways; however, structs are value types rather than reference types, and inheritance is not supported for structs. Struct values are stored on the stack or in-line. Careful programmers...
-
C# Interview Questions
Ans