Answered Questions

  • When to use string classes

    when we have string builder which are mutable why we need immutable string classes in C#.

    Denial

    • Aug 14th, 2013

    String: String are immutable that is every time you make changes to a string object, the string is destroyed and a new string is created with modifications you applied to previous string. All this is ...

    Sivavt

    • Mar 25th, 2012

    String is immutable, meaning, if there is any change in the string value, run time allocates new memory & assign it to the string reference. For the programmer, it looks like the same string but inter...

  • How do I get deterministic finalization in C#?

    In a garbage collected environment, it's impossible to get true determinism. However, a design pattern that we recommend is implementing IDisposable on any class that contains a critical resource. Whenever this class is consumed, it may be placed in a using statement, as shown in the following example: using(FileStream myFile = File.Open(@"c:temptest.txt", FileMode.Open)){int fileOffset = 0;while(fileOffset...