What is difference between Convert.ToString(variable) and
variable.ToString()
Answer Posted / pavel
object ss =null;
string s1 = ss.ToString(); ---------- exeption
string s2 = Convert.ToString(ss); --- ""
--------------------
int ss =null; --- int can't be converted to null
--------------------
int ss = 1;
string s1 = ss.ToString(); ---------- "1"
string s2 = Convert.ToString(ss); --- "1"
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What is a c# delegate?
How do you name a variable in c#?
Why do we need generics?
Is c# an array?
What is local function?
What are controls in c#?
How to find methods of a assembly file (not using ILDASM)?
What exception can an overridden method throw in comparison with the method it is overriding?
If I have more than one version of one assemblies, then how'll I use old version (how/where to specify version number?)in my application?
Are constructors inherited c#?
Can hashset contain duplicates c#?
What is polymorphism and its types in c#?
What's the difference between abstraction and encapsulation?
How many parameters can a method have c#?
What is byte c#?