Explain Direct CAST vs CType ?



Explain Direct CAST vs CType ?..

Answer / 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

More C Sharp Interview Questions

What is the use of console readkey ()?

1 Answers  


int i = 1; int j = 1; System.Console.WriteLine(i == j); System.Console.WriteLine(i.ToString() == j.ToString()); System.Console.WriteLine((object)i == (object)j); Give the sample code above, what is the output to the console?

5 Answers  


What are the benefits of using the aggregate method in linq?

1 Answers  


How to do and Apply Themes to Datagrid,Lable,Textbox,etc., in C#.NET 2005 Windows Application? (like who we will do themes in ASP.NET using .CSS and .SKIN files). Urgent!!

1 Answers  


What is the difference between ienumerable and iqueryable?

1 Answers  


What is windows application in c#?

1 Answers  


Explain About multi level and multiple inheritance how to achieve in .net

1 Answers  


What is anonymous method in c#?

1 Answers  


What Is A Multicast Delegate?

1 Answers   Siebel Systems,


What is a partial class in c#?

1 Answers  


What is c# used for?

1 Answers  


When Should You Call The Garbage Collector In .net?

1 Answers   Siebel Systems,


Categories