adspace


Explain Direct CAST vs CType ?

Answer Posted / Minakshi Rani

Direct cast in C# is used to convert one type of object into another specific type. The syntax for this is (target-type)object. For example: int x = (int)myObject; CType in VB.NET is similar to direct cast but can perform implicit conversions if the compiler decides it's safe.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which namespaces are necessary to create a localized application?

1142


Why can't we use a static class instead of singleton?

954


What is an abstract class c#?

969


What is expression tree in c#?

998


How to assign Null value to Var?

1064


How do you inherit a class into other class in c#?

995