![]() |
| Home | Tech FAQ | Interview Questions | Placement Papers | Tech Articles | Learn | Freelance Projects | Online Testing | Geeks Talk | Job Postings | Knowledge Base | Site Search | Add/Ask Question |
![]() 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 : Constant : The constants are the one whose value remain same at all the time.it will be used if u want to define something at compile time.Read only....if you don't know value at compile time but u can find that at runtime that time u can use ... 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. ... If you leave off the return type on a method declaration, the compiler thinks you are trying to declare a constructor. So if you are trying to declare a method that returns nothing, use void. The following Latest Answer : If your method does not have any return type then mention void before that method or return 0 ... 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 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{ ... No. C# does, however, support the concept of an indexer from language spec. An indexer is a member that enables an object to be indexed in the same way as an array. Whereas properties enable field-like Latest Answer : Ans:No ... 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 : Namespaces is not correct - The protected modifier allows the field to be accessed only by the inherting class and the base class. If you were to put the modifier 'protected internal' then the field can be accessed by inheriting classes and also by classes ... Yes, if you are debugging via Visual Studio.NET, just go to Immediate window. Latest Answer : Yes. Go to immediate window in VS.net and use >eval var = newvalue ... Value, and its datatype depends on whatever variable we're changing. Latest Answer : Ans: Value :parameter gets passed into the class' set method ...
Sponsored Links
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||