March 2004
Intermediate to advanced
560 pages
26h 47m
English
using System;
namespace Samples
{
public class ArgumentExceptionSample
{
public static void Main()
{
try
{
string s = "one";
s.CompareTo(1);
}
catch(ArgumentException e)
{
Console.WriteLine("Exception: {0}", e);
}
}
}
}
Exception: System.ArgumentException: Object must be of type String. at System.String.CompareTo(Object value) at Samples.ArgumentExceptionSample.Main() in C:\Books\BCL\Samples\System\ ArgumentException\ArgumentException.cs:line 12
Read now
Unlock full access