1) Write an example of implicitly converting an object to string2) Write an example of explicitly converting an object to string

Showing Answers 1 - 2 of 2 Answers

PavanKumar S

  • Feb 4th, 2007
 

DotNet Framework is a completely Object Oriented Model. Everything that is present in .Net(Major Part) are Objects.So, we create Objects for the classes and use them. So we are only working with the Objects.Let me make it even more clear with an example :String s; //Here S is an Object Of String Classs="Hello Dotnet Programmers"; //Here I am assigning it with a valueHere I am creating a object for the String Class and I am assigning it to a value of string how this hapens is .Net framework inmplicitly converts the Obj To String as per the requirement. And if at all we wanna convert a Object Type to string Type use the .ToString() which would convert the Objet Type To String Type.

  Was this answer useful?  Yes

Radhika

  • Mar 16th, 2007
 

If a is an object, we need to convert it as string just add .ToString() extension.
dim b as string
b=a.Tostring()

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions