![]() Related Questions The difference is that static read-only can be modified by the containing class, but const can never be modified and must be initialized to a compile time constant. To expand on the static read-only case Latest Answer : As static read-only variables must be initialized in the static constructor (static constructor cannot have parameters and it cannot be called manually), it is efficient to used const variables over static read-only variables if you know the values ... The word checked is a keyword in C#. Latest Answer : Reason is checked is a keyword in C#,but if u want to keyword as an identifier use @ with it.e.g int @checked=3;This works with all the keywords,but it is recommended to avoid it. ... Make sure that the target type set in the project properties setting is set to Windows Application, and not Console Application. If you're using the command line, compile with /target:winexe & Latest Answer : Compile with following syntax at command line : csc /t:winexe ... I was trying to use an "out int" parameter in one of my functions. How should I declare the variable that I am passing to it? You should declare the variable as an int, but when you pass it in you must specify it as 'out', like the following: int i;foo(out i);where foo is declared as follows: [return-type] foo(out int Yes, you can use System.Environment.Exit(int exitCode) to exit the application or Application.Exit() if it's a Windows Forms app. Latest Answer : Ans:YesSystem.Environment.Exit(int exitCode) to exit the application or Application.Exit() if it's a Windows Forms app. ... Some security exceptions are thrown if you are working on a network share. There are some parts of the frameworks that will not run if being run off a share (roaming profile, mapped drives, etc.). To see Latest Answer : ans:Yes,this is right. ... If you try to instantiate the class inside the try, it'll be out of scope when you try to access it from the catch block. A way to get around this is to do the following: Connection conn = null; try Latest Answer : ans:Answer: If you try to instantiate the class inside the try, it'll be out of scope when you try to access it from the catch block. A way to get around this is to do the following: Connection conn = null; try {conn = new Connection();conn.Open();}finally{ ... Value, and its datatype depends on whatever variable we are changing. Latest Answer : Ans:value is implicit name of the parameter that gets passed into the class set method. ... Classes in the same namespace. Latest Answer : Its available only to the derived classes and not all the classes in the NameSpace ... When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class. Latest Answer : Overriding a method involves changing the business logic og the method, however the return type and parameters remain same. However in overloading a method you can have multiple methods with same name but different signatures. ...
Sponsored Links
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||