1.编写示例程序展示为什么
package com.horseman.impatient不同于
package com
package horseman
package impatient
第一种方式中,T3可以访问T1,T2类
package com{
class T1{
}
package horseman{
class T2{
}
package impatient{
class T3(t1:T1,t2:T2){
}
}
}
}
第二种方式则访问不了
package com.horseman.impatient{
class T4(t3:T1){
}
}
2.编写一个令人困惑的scala 代码,使用一个不再顶部的com包,需要注意的是包的引入可以在程序的任意位置,并且引入最上级的包并不能使用子包中元素
package com{
class T1{
}
package horseman{