Interviews - C# Corner

Brajesh Kumar
What is the difference between Convert.ToString() and .ToString()?
By Brajesh Kumar in .NET on Jan 13 2017
  • Vickey Kumar
    Feb, 2017 24

    can you Explain with a program

    • 3
  • Brajesh Kumar
    Feb, 2017 25

    int i= 0; MessageBox.Show(i.ToString()); MessageBox.Show(Convert.ToString(i));

    • 2
  • Brajesh Kumar
    Jan, 2017 13

    Convert.ToString() handles null, while ToString() doesn't. explanation with C# Code.............. Un Safe code ...................................Try' In this code we will get "Object reference not set to an instance of an object." exceptionDim a As Objecta = Nothinga.ToString()Catch ex As NullReferenceExceptionResponse.Write(ex.Message)End Try'............... it is a safe code..............................Dim b As Objectb = NothingConvert.ToString(b)

    • 2
  • Rameshyadav Medaboina
    Nov, 2017 15

    Convert.ToString() handles null value but .ToString() does not handle null value. Example:-string str; object i = null; str = i.ToString();------>It Throws errorstring str; object i = null; str = Convert.ToString(i);-->It does not throgh error

    • 1
  • Sudheshwer  Rai
    Jun, 2017 1

    Convert.ToString() handles null value but .ToString() does not handle null value.

    • 1
  • Ashish Srivastava
    Jan, 2018 10

    Convert.ToString() handles null .ToString() not handles null

    • 0
  • Ashish Srivastava
    Jan, 2018 10

    Convert.ToString() handles null .ToString() not handles null

    • 0
  • Suresh Kumar
    Oct, 2017 28

    Convet.ToString() will handle null values and ToString not

    • 0
  • Suresh Kumar
    Oct, 2017 28

    Convet.ToString() will handle null values and ToString not

    • 0
  • Suresh Kumar
    Oct, 2017 28

    Convet.ToString() will handle null values and ToString not

    • 0
  • Suresh Kumar
    Oct, 2017 28

    Convet.ToString() will handle null values and ToString not

    • 0
  • Suresh Kumar
    Oct, 2017 28

    Convet.ToString() will handle null values and ToString not

    • 0
  • Suresh Kumar
    Oct, 2017 28

    Convet.ToString() will handle null values and ToString not

    • 0
  • Mukesh Kumar
    Sep, 2017 2

    Convert executes before statement

    • 0

Most Popular Companies

Most Popular Job Functions

MOST LIKED QUESTIONS