4.How can you save the desired properties of Windows Forms application? .config files
in .NET are supported through the API to allow storing and retrieving information. They are
nothing more than simple XML files, sort of like what .ini files were before for Win32 apps.
8.What\u2019s the safest way to deploy a Windows Forms app? Web deployment: the user
always downloads the latest version of the code; the program runs within security sandbox,
properly written app will not require additional security privileges.
12.How would you create a non-rectangular window, let\u2019s say an ellipse? Create a
rectangular form, set the TransparencyKey property to the same value as BackColor, which
will effectively make the background of the form transparent. Then set the FormBorderStyle
to FormBorderStyle.None, which will remove the contour and contents of the form.
14.How\u2019s anchoring different from docking? Anchoring treats the component as having the
absolute size and adjusts its location relative to the parent form. Docking treats the
component location as absolute and disregards the component size. So if a status bar must
always be at the bottom no matter what, use docking. If a button should be on the top right,
but change its position with the form being resized, use anchoring.
Notice that it\u2019s double colon in C++.
3.Does C# support multiple inheritance? No, use interfaces instead.
4.When you inherit a protected class-level variable, who is it available to? Classes in the
now you have to write one yourself, even if there\u2019s no implementation in it.
8.What\u2019s the top .NET class that everything is derived from? System.Object.
9.How\u2019s method overriding different from overloading? When overriding, you change the
12.Can you override private virtual methods? No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access.
15.What\u2019s an abstract class? A class that cannot be instantiated. A concept in C++ known as
pure virtual method. A class that must be inherited and have the methods over-ridden.
Essentially, it\u2019s a blueprint for a class without any implementation.
20.And if they have conflicting method names? It\u2019s up to you to implement the method
inside your own class, so implementation is left entirely up to you. This might cause a
problem on a higher-level scale if similarly named methods from different interfaces expect
different data, but as far as compiler cares you\u2019re okay.
21.What\u2019s the difference between an interface and abstract class? In the interface all methods must be abstract; in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes.
24.What\u2019s the difference between System.String and System.StringBuilder classes?
System.String is immutable; System.StringBuilder was designed with the purpose of having
a mutable string where a variety of operations can be performed.
25.What\u2019s the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text.
Strings are immutable, so each time it\u2019s being operated on, a new instance is created.
33.Can multiple catch blocks be executed? No, once the proper catch code fires off, the
control is transferred to the finally block (if there are any), and then whatever follows the
34.Why is it a bad idea to throw your own exceptions? Well, if at that point you know that
an error has occurred, then why not write the proper code to handle that error instead of
passing a new Exception object to the catch block? Throwing your own exceptions signifies
some design flaws in the project.
37.How\u2019s the DLL Hell problem solved in .NET? Assembly versioning allows the
application to specify not only the library it needs to run (which was available under
Win32), but also the version of the assembly.
This action might not be possible to undo. Are you sure you want to continue?