0
C#用户定义的转换有没有在Java中类似User-Defined conversions或者我如何能acchive在java中相同的效果而无需添加的.toXXXX
方法替代Java中
几十任何建议,我没有使用C#一会儿所以我不记得正确的名字,但我还记得,在C#我能传递给函数的第一个参数,而无需使用符号
Foo(MyClass instance)
而是
instance.Foo()
如果我没有记错,我不得不使用MyClass的东西在此之前关键词中Foo(this MyClass instance)
但正如我说我没有使用C#的一段时间,所以我不记得
谁能告诉我有什么选择这两个“方法“在Java中
Java没有[扩展方法](http://msdn.microsoft.com/zh-cn/library/bb383977.aspx)。 – dasblinkenlight 2012-04-21 11:17:18