可変引数の不思議(C#版)
C#でも全く同じなんだな。
interface IHoge { void Hoge(params string[] args); void Piyo(string[] args); } class Hoge : IHoge { void Hoge(string[] args) {} void Piyo(params string[] args) {} }
Hoge h1 = new Hoge(); // これはコンパイルエラー //h1.Hoge("hoge", "piyo", "foo", "bar"); h1.Piyo("hoge", "piyo", "foo", "bar"); IHoge h2 = h1; h2.Hoge("hoge", "piyo", "foo", "bar"); // これはコンパイルエラー //h2.Piyo("hoge", "piyo", "foo", "bar");