这个小程序本身有什么问题?该怎么该????????,详细解答下
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace ConsoleApplication1
{
class Program
{
public static string operator * (string a, string b)
{
return (a + b);
}
static void Main(string[] args)
{
string str1 = "hello ";
string str2 = "world!";
string str3 = str1 * str2;
Console.WriteLine(str3);
}
}
}
//Error 1 One of the parameters of a binary operator must be the containing type
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace ConsoleApplication1
{
class Program
{
public static string operator * (string a, string b)
{
return (a + b);
}
static void Main(string[] args)
{
string str1 = "hello ";
string str2 = "world!";
string str3 = str1 * str2;
Console.WriteLine(str3);
}
}
}
//Error 1 One of the parameters of a binary operator must be the containing type
{
public string TEST_PROPERTY
{
get; set;
} public static string operator *(TEST test,string param2)
{
// add your own code here
return "";
}
}