object run{
class a{
def run(){
print("run")
}
}
class b{
def fly(): Unit ={
print("fly")
}
}
def main(args: Array[String]): Unit = {
implicit def a2b(a:a) =new b();
var a = new a()
a.fly()
}
}
转载于:https://www.cnblogs.com/mrerror/p/10916294.html
object run{
class a{
def run(){
print("run")
}
}
class b{
def fly(): Unit ={
print("fly")
}
}
def main(args: Array[String]): Unit = {
implicit def a2b(a:a) =new b();
var a = new a()
a.fly()
}
}
转载于:https://www.cnblogs.com/mrerror/p/10916294.html