どうしてこうなった...
class Class1
{
public object operate(object obj)
{
if (obj.GetType() == typeof(int))
{
return (int)obj + 1;
}
else if (obj.GetType() == typeof(string))
{
return ((string)obj).Split(',');
}
else if (obj.GetType() == typeof(double))
{
return (double)obj * 2;
}
else
{
return null;
}
}
}
まだコメントがありません。最初にコメントを残しませんか?