![]() 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 ... C# requires only a single parameter for delegates: the method address. Unlike other languages, where the programmer must specify an object reference and the method to invoke, C# can infer both pieces of Latest Answer : This article is good.IntroductionIn this article I am going to share my knowledge on Delegates in C#.This would explain the Delegate using simple examples so that the beginner can understand the same.What is Delegate?Definition:Delegate is type which ... 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 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 Latest Answer : Following are the main points of difference between classes and structs in C#:Value type vs Reference type: Structs are value type and classes are reference type. Whenever a struct object is assigned to another struct object a copy is created. In case ... 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. ... C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write? Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there is no implementation in it. 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. Latest Answer : Abstract classes act as the buliding block whose object cannot be created. We include common functionality in abstract class which can inherited by the sub classes. They are not 100% abstract whereas interface provide 100% abstraction in this no function ... Tags : Abstract Different parameter data types, different number of parameters, different order of parameters. Latest Answer : A method can be overloaded by having different parameters as in different type of parameters and well different number of parameters.Also, if the parameter types are different than you can also have different return type.example :you can have public int ... If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor? Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class. System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed. Latest Answer : Answer: System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed. function checkf(form) { var f = document.form1;if (document.form1.cmt.value=='') { alert('Please ...
Sponsored Links
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||