61⟩ ctype(123.34,integer) - should it throw an error? Why or why not?
Answer1
It would work fine. As the runtime type of 123.34 would be double, and Double can be converted to Integer.
Answer2
the ctype(123.34,integer) will work fine no errors
“Learn C# (Sharp) Programming Language by Interview Questions and Answers”
Answer1
It would work fine. As the runtime type of 123.34 would be double, and Double can be converted to Integer.
Answer2
the ctype(123.34,integer) will work fine no errors
It would throw an InvalidCast exception as the runtime type of 123.34 (double) doesnt match with Integer.
Answer1
A Sub does not return anything whereas a Function returns something.
Answer2
-A Sub Procedure is a method will not return a value
-A sub procedure will be defined with a “Sub” keyword
Sub ShowName(ByVal myName As String)
Console.WriteLine(”My name is: ” & myName)
End Sub
-A function is a method that will return value(s).
-A function will be defined with a “Function” keyword
Function FindSum(ByVal num1 As Integer, ByVal num2 As Integer) As Integer
Dim sum As Integer = num1 + num2
Return sum
End Function
You must use the Missing class and pass Missing.Value (in System.Reflection) for any values that have optional parameters.
There are imperative and interrogative functions. Imperative functions are the one which return a value while the interrogative functions do not return a value.
Two types of properties in .Net: Get and Set
Constructor is a method in the class which has the same name as the class (in VB.Net its New()). It initialises the member attributes whenever an instance of the class is created.
Call the dispose method from code for clean up of objects
65536.
Locked Porperty.
BY VAL: changes will not be reflected back to the variable.
By REF: changes will be reflected back to that variable.( same as & symbol in c, c++)
System.Int32
1. System.Int16
2. System.Int32
3. System.Int64
4. System.Int128
1. string s = #.n Test string.;
2. string s = ..n Test string.;
3. string s = @.n Test string.;
4. string s = .n Test string.;
1. int[,] myArray;
2. int[][] myArray;
3. int[2] myArray;
4. System.Array[2] myArray;
1. Classes that are both in the same assembly and derived from the declaring class.
2. Only methods that are in the same class as the method in question.
3. Internal methods can be only be called using reflection.
4. Classes within the same assembly, and classes derived from the declaring class.
1. Encapsulating an object in a value type.
2. Encapsulating a copy of an object in a value type.
3. Encapsulating a value type in an object.
4. Encapsulating a copy of a value type in an object.
C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection. More at http://msdn.microsoft.com/vstudio/nextgen/technology/csharpintro.asp, http://msdn.microsoft.com/library/default.asp?URL=/library/dotnet/csspec/vclrfcsharpspec_Start.htm and http://msdn.microsoft.com/vstudio/nextgen/technology/csharpdownload.asp
1. /text
2. /doc
3. /xml
4. /help
When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.